[ciapug] I hate dates...

Lathrop Preston ciapug@cialug.org
Sat, 29 Jan 2005 10:54:15 -0600


I may be missing something... but can't you just do this?

	$myTimestamp = {mysql value}
	$dArr = explode(' ',$myTimestamp);
	$theDate = $dArr[0];

I think you are trying to feed the 1947 (before epoc) date to the php 
time/date related functions. the result will be odd.

Lathrop

Chris Hettinger 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@cialug.org
> http://cialug.org/mailman/listinfo/ciapug