["Timothy Wright" <[EMAIL PROTECTED]>]
> The only problem is .... I'm not starting with a Unix timestamp.  The
> variable is passed from a form as YYYYmd (or 2001223... no leading zeros in
> the month or day).  The PHP date function allows these characters in the
> string...
> "Y" - 4-digit year,
> "n" - month without leading zeros; i.e. "1" to "12"
> "j" - day of the month without leading zeros; i.e. "1" to "31"
> ... so echo date("Y-n-j") would give me the output in the right format, but
> I need to convert the input to a valid timestamp first.
> Any ideas?? Am I missing something really obvious...it's late and my brain
> is tired..

If there are no leading zeroes in the month and day you're screwed
anyway, because you can't tell the difference between for example
2000121 (january 12th, 2000) and 2000121 (december 1st, 2000).

You should fix the form to either pad the numbers or insert a
character between year, month and day.

 - Stig
  Stig Sæther Bakken <[EMAIL PROTECTED]>  (AIM: Stig S B)
  Fast Search & Transfer ASA, Trondheim -- Phone +47 73 20 12 13

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to