| Jerry Weida on Fri, 28 Jan 2005 14:27:03 -0600 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: [ciapug] I hate dates... |
You can always have MySQL generate the correct format for you. Use something like the following: select DATE_FORMAT(date_field, '%Y-%m-%d') from table; On Fri, 28 Jan 2005 13:58:22 -0600, Chris Hettinger <cjh@xxxxxxxxxxx> wrote: > I need a reliable function that I can pass a MySQL time stamp like > (1978-07-03 00:00:00) and have it return to me only the date portion ... > > I wrote something that just splits the datestamp, ignores the time > portion and make a new date with the year, month, and day. I am however > getting some returning incorrect. > > Passed this: 1947-08-30 00:00:00 > Got this: 1969-12-31 > > I know there must be something wrong and I know that 1969 date indicates > that but I don't know what to do and it's been a really LONG week... > > Can anyone do a little hand-holding for a moment :-\ > > -ch > > _______________________________________________ > ciapug mailing list > ciapug@xxxxxxxxxx > http://cialug.org/mailman/listinfo/ciapug > _______________________________________________ ciapug mailing list ciapug@xxxxxxxxxx http://cialug.org/mailman/listinfo/ciapug