Formatting PHP Time



Hi,

I have time stored as the following: YYYY-MM-DD HH:MM:SS, so it gives
something like 2006-01-26 01:40:14. I'm trying to get the format to be Jan
26, 2006 1:40. I try something like this:

$t2 = date('M d, Y g:i', $t);

But it gives the wrong date, so I must be doing something wrong. I've looked
all over for date formatting but they only seem to be able to format the
date and then insert it into the database, but my database already has dates
in this format and I'd prefer not to change the way the dates are stored.
Can you help explain the proper way to format a date?

I also attempted to store the date/time as a timestamp but was never
successful at acheiving that. I produced the timestamp (lots of numbers),
but when I tried to put it into the database, it seemed to reject it and I
ended up with 0000-00...etc.

Thanks,
- Eli


.



Relevant Pages

  • Re: [PhP - dB] About Formatting a Date Result
    ... In the MySQL database the field is set to date not timestamp as you ... foresight has stored a string date instead of a timestamp, ... and can format your date to that used, in the config files, for any user ...
    (php.general)
  • Re: Protel 2004 answer to Brad Velander.
    ... Sorry, you misunderstand me, I mean to say that jump from 99SE to 2004 XP ... you don't have the same format with one database will all the documents. ... Well you said that you can export file format more recent than AUTOCAD 14 ... key/mouse click you press because I don't know how to do that with Protel ...
    (sci.electronics.cad)
  • Re: Converting DD MM YYYY into YYYY-MM-DD?
    ... date representation format defined by ISO 8601. ... you should generate the map based on the standard library (in ... the underlying C standard library) locale database ... Doesn't the database have a timestamp data type? ...
    (comp.lang.python)
  • Re: Combo box not finding record... sometimes
    ... Try the Format option last. ... Private Sub cboLnNum_AfterUpdate ... when I change the data type from Double to Long Integer the database ...
    (microsoft.public.access.formscoding)
  • Re: Error Message: Cant find Installable ISAM
    ... The database is residing on my machine, ... Error Message = "Couldn't find Installable ISAM" ... Connect property set = Access ... Access 2002/2003 format and tried this as a possibility, ...
    (microsoft.public.vb.database)