Results 1 to 2 of 2

Thread: php date(1) function

  1. #1
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default php date(1) function

    Hi
    i came across this code in an application
    PHP Code:
    $jd cal_to_jd(CAL_GREGORIAN$thismonthdate(1), $thisyear); 
    what is the purpose of date(1) ? i checked php manual but could not find why there is an integer. most of the time i have used date('Y') or date('m') or other similar usages where i always passed some kind of format as string.

    thanks

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I have no idea what that is doing. The parameters for date() are specific characters that display parts of the current time (like d= day, etc), and any other characters are just output in the string. As far as I know, that would just (always) display '1'. Technically that is not incorrect PHP, but just useless.
    Then again, run the code and see what you get. There's no documentation about numerical values on php.net, though.

    The only other thing that comes to mind is a strange typo from 'l' as the characters look alike (1/l), but that seems unlikely. "l" would give "A full textual representation of the day of the week".


    Since there appears to be no other way to understand it (easily, anyway), I suggest that you instead try to figure out what $jd is, and why it holds such values-- then you can determine what is going on with date(1).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •