For the past year, we've been storing date-time values into a custom field _date
using strtotime(). There are about 100 PHP date-time stamps in our database from over the past year.
I would really like to use a jQuery datepicker for this custom field - to make it more user friendly. However, the datepicker stores date values differently. Even if I use UNIX time, it adds "000" to the end. This creates problems on the front-end retrieving the data and sorting through it accurately.
From what I can see, I have two basic options.
- Convert all current
_date
values to JS values - Write my code on the front end to account for both JS and PHP values.
I'm using the Advanced Custom Fields datepicker. I think the cleanest way to do this would be to update the existing values in the database to JS time-stamps. Is there an easy way to do this? I don't really feel like manually updating > 100 dates.
All values in this custom_field are currently like this:
1375820168
(php in seconds)
I need them to be like this:
1375820168000
(js in milliseconds)
Or this:
20130706
(js yymmdd)