tags:

views:

21

answers:

1

i use bigint(10) to save format date in Myphpadmin. but i can't show format d/m/Y in my website. Please! help me. i Use folow:

<?php $sqldate = strtotime($row['ngaysinh']);echo date('d/m/y',$sqldate); ?>
A: 

It sounds like you are using a UNIX time stamp to store the date. As such using strtotime() with an integer will return -1 (it's not a date string) and so what you are actually doing is:

echo date('d/m/y',-1);

which doesn't output anything. Instead, use the following code:

echo date('d/m/y',$row['ngaysinh']);
gabe3886
oh, I'm sorry but i can't, Although i used code<?php echo date('d/m/y',$row['ngaysinh']);?>i show follow: 01/01/1970 and replay 01/01/1970
Vuong Mao
what do you get out put if you echo $row['ngaysinh'] ?
gabe3886
@Vuong please show some of the *original database data* you are using.
Pekka
i think if used data(string $fomat[,int $timestamp]) will be than. but i don't know use "timestamp". Please!help me. Thank you so much.
Vuong Mao
@Vuong - the $timestamp is a unix timestamp which, by the looks of what you said in the original questions is what is stored in the table. Can you provide a sample of the data you are trying to use so we can check?
gabe3886