I wrote a script (PHP) that communicates with the API (Java). One of the required parameters is a date of birth in the long format [from 01.01.1970]. How do i can convert my php date dd-mm-yy to Java long?
Asked
Active
Viewed 35 times
0
-
For one thing, you need to decide on a time zone. For another, you need to decide on the time of day that you are going to convert it at (e.g. midnight (which may not exist, depending on date and timezone), noon) etc. – Andy Turner Nov 15 '16 at 11:28
-
I would strongly advise against storing a local date as a long, though (unless you're storing the number of days since some datum like 1970-1-1). Doing so is a quick and easy path to pain. – Andy Turner Nov 15 '16 at 11:31
-
Both languages support the unix_timestamp if you must convert it at all. It is best to send the date in its original format then use that particular language date/time functions to extract and manipulate the data. – Nov 15 '16 at 11:35