Ok, I am trying to convert the javascript label to the php equivalent, I looked through the messages here on the stack for a decent answer, as well as for various other sites, so this question comes as a last effort, despite the fact that I know that I can get and someone tells me nothing more than a question of cheating from another place. So despite this ..
This is my failure attempt so far. Please note: I am using jQuery, and noConflict, therefore j , not $
var yr = j('#time_year :selected').val();//year var mn = j('#time_month :selected').val();//month var dy = j('#time_day :selected').val();//day var hr = j('#time_hour :selected').val();//hour var min = j('#time_minute :selected').val();//minute var sc = j('#time_second :selected').val();//second if(j('#time_ampm :selected').val() == 12 && j('#time_hour :selected').val() < 12){hr = j('#time_hour :selected').val()+12;} if(j('#time_ampm :selected').val() == 0 && j('#time_hour :selected').val() == 12){hr = 0;} var theDate = new Date(yr, mn, dy, hr, min, sc).getTime(); setTimeStamps(theDate); j('#timestamp_now_js').html(" "+theTime); j('#timestamp_now_php').html(" "+Math.round(theTime / 1000));
The selection values ββat the top are based on a link to a Mozilla.org link using 0-nn as they are described. Where, like am / pm if-else, in essence, means to add 12 hours to the selected time, since the time displayed on the site is a 12-hour format. Javascript uses 24 hours. Its also there, if am is selected and using 12, it converts 12 to 0 to fit the 24-hour formatting concept.
Currently, it seems to be happening that, although it works, when I run the timestamp set using the php date() function, it shows a date that is about a month 2 weeks and a few days, the chapter of that that I'm testing from, which is equivalent now
I would create a jsFiddle of everything that was included in html, but I use php to create my selection fields. Thus, if you want to see that I have a "live", go to http://7pz.net/timestamps.php , as I am testing the concept.