Jump to content

php date


westman

Recommended Posts

hi all this is my 1st post :)i have this code to sand a date from 3 drop down menu's to my DB and its working for me :)$date = "$b_y-$b_m-$b_d";but how do i send my $date from my DB to display in my 3 drop down menu's?thank you in advance.

Link to comment
Share on other sites

date will help you extract any part of a date you want from a Unix timestamp.strtotime will convert a date string to a Unix timestamp if it's in one of the permitted formats. I can't tell if your format is one of these, so I suggest just trying it.If it's not to late, consider storing all dates in your database as a timestamp. It saves a few conversion steps when storing and then accessing the data.
Link to comment
Share on other sites

date will help you extract any part of a date you want from a Unix timestamp.strtotime will convert a date string to a Unix timestamp if it's in one of the permitted formats. I can't tell if your format is one of these, so I suggest just trying it.If it's not to late, consider storing all dates in your database as a timestamp. It saves a few conversion steps when storing and then accessing the data.
can you give an example please, am new to the php world and do not understand a lot, all i know is i have$b_m$b_d$b_yand need to get$b_y = "Y";$b_m = "m";$b_d = "d"; and then get the Y, m, d to display the date in 3 different drop down menu's
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...