[sf-lug] https://www.sf-lug.org/ September 01st

Akkana Peck akkana at shallowsky.com
Wed Aug 28 07:42:27 PDT 2019


I'm only an occasional PHP programmer, but googling PHP date found this:
https://www.php.net/manual/en/function.date.php
The first argument to date() is a format string.

In the code you quoted:
echo "The next meeting is on <b>" . date('l F dS', $meeting);

So it's calling date with 'l F dS' as a format string. Scrolling
down to where it documents the format strings:

l (lowercase 'L')  A full textual representation of the day of the week
F  A full textual representation of a month, such as January or March
d  Day of the month, 2 digits with leading zeros
S  English ordinal suffix for the day of the month, 2 characters

Note those leading zeros on the description of d. Two lines below it,
they list:
j  Day of the month without leading zeros

So try changing the format string to 'l F jS' and see if that helps.

PHP, whatever its other faults may be, does have pretty good online
documentation.

        ...Akkana

Michael Paoli writes:
> https://www.sf-lug.org/ September 01st
> So, ... maybe someone wants to fix that PHP code?  Or
> suggest exactly what needs to be changed in it?
> (I am not a PHP programmer).
> 
> Or better yet, as Jim suggested long ago, don't use PHP, but
> have a crontab job update static page.
> 
> I think there's 'bout half a dozen folks (... yes, 5) with
> sufficient login+sudo access to be able to implement
> either of those solutions.
> Y'all don't need to have me do *everything*.  ;-}
> 
> references/excerpts:
> $ sed -ne '/next meeting/,/Cafe Enchante/p' /var/www/www.sf-lug.org/index.php
> echo "The next meeting is on <b>" . date('l F dS', $meeting);
> if (date('l', $meeting) == "Sunday") {
>         $mtg_time = "11:00 AM till 1:00 PM";
> 
>         } else {
>         $mtg_time = "6:00 PM till 8:00 PM";
> 
> }
> 
> echo ", from $mtg_time</b>, at the Cafe Enchante, on Geary at 26th Ave in
> San Francisco.";
> $
> $ hostname --fqdn; sudo sh -c '(cd /etc/sudoers.d/ && for u in [!Rl]*; do
> sudo -l -U "$u" | sed -ne '\''/^User .* may run/,${/^User
> /{p;n};/chsh/d;/sflugwww/p;/ ALL$/p}'\'' ; done)'
> balug-sf-lug-v2.balug.org
> User grantbow may run the following commands on balug-sf-lug-v2:
>     (root) /bin/su - sflugwww
> User jstockford may run the following commands on balug-sf-lug-v2:
>     (root) /bin/su - sflugwww
> User kdavalos may run the following commands on balug-sf-lug-v2:
>     (root) /bin/su - sflugwww
> User mpaoli may run the following commands on balug-sf-lug-v2:
>     (ALL) NOPASSWD: ALL
> User rick may run the following commands on balug-sf-lug-v2:
> User sflugwww may run the following commands on balug-sf-lug-v2:
> User thawley may run the following commands on balug-sf-lug-v2:
>     (root) /bin/su - sflugwww
> $
> 
> 
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
> SF-LUG is at http://www.sf-lug.org/



More information about the sf-lug mailing list