daGrevis Posted May 1, 2010 Report Share Posted May 1, 2010 Sveiki, Man lietotāja reģistrācijas laiks glabājās datubāzē, kā sekundes (dabūts no time()). Ir nepieciešams, pēc izvadīšanas kur pašā lapā, šīs sekundes pārkonvertēt sakarīgā, cilvēka lasāmā laikā, piemēram... 27. aprīlis, 2010. gads. 14:45. Quote Link to comment Share on other sites More sharing options...
bobsters Posted May 1, 2010 Report Share Posted May 1, 2010 (edited) $time=time(); $datums=date('Y-M-d H:i',$time); Edited May 1, 2010 by bobsters Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 1, 2010 Author Report Share Posted May 1, 2010 Totāls supers!! :) Paldies. :) Quote Link to comment Share on other sites More sharing options...
Pentiums Posted May 1, 2010 Report Share Posted May 1, 2010 RTFM HEHE :) Quote Link to comment Share on other sites More sharing options...
edi Posted May 1, 2010 Report Share Posted May 1, 2010 kā mktime var dabūt no šāda datuma 2010.05.01 ? Quote Link to comment Share on other sites More sharing options...
ABU Posted May 1, 2010 Report Share Posted May 1, 2010 Sākumā ar substr sadali pa daļām un tālāk izmanto mktime funkciju: $datums='2010.05.01'; $diena=substr($datums,8,2); $menesis=substr($datums,5,2); $gads=substr($datums,0,4); mktime(0,0,0, $menesis, $diena, $gads); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.