Chaori Posted December 9, 2008 Share Posted December 9, 2008 I know date can be done like: echo date(H) . ":" . (j) . ":" . (s); but how do I assign the current time and date to variables? I know the following code doesn't work, I'm just using it as an example for what I want to do.. $time='(H) . ":" . (i) . ":" . (s)'; $date='(j) . "/" . (m) . "/" . (y)'; If anyone understands what I mean can you tell me how I assign $time and $date? Thanks. Link to comment https://forums.phpfreaks.com/topic/136199-solved-need-help-with-date-and-time/ Share on other sites More sharing options...
Chaori Posted December 9, 2008 Author Share Posted December 9, 2008 Just did a bit of reading, wouldn't happen to be: $date=date("d/m/y"); $time=date("H:i:s"); Would it? Link to comment https://forums.phpfreaks.com/topic/136199-solved-need-help-with-date-and-time/#findComment-710441 Share on other sites More sharing options...
gevans Posted December 9, 2008 Share Posted December 9, 2008 Yes it would, but why don't you just try it?? Link to comment https://forums.phpfreaks.com/topic/136199-solved-need-help-with-date-and-time/#findComment-710443 Share on other sites More sharing options...
Chaori Posted December 9, 2008 Author Share Posted December 9, 2008 Sorry, I just like second opinions on things before I try them... Sorry. Link to comment https://forums.phpfreaks.com/topic/136199-solved-need-help-with-date-and-time/#findComment-710449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.