BassMan Well-known member Oct 29, 2017 #1 Hi, if I have a date format in mysql like this 1507670047, how can I know what date that really is? Is there any converter for this? I'd like to export some tables and would like to have dates in known format. Thank you. BassMan
Hi, if I have a date format in mysql like this 1507670047, how can I know what date that really is? Is there any converter for this? I'd like to export some tables and would like to have dates in known format. Thank you. BassMan
Chris D XenForo developer Staff member Oct 29, 2017 #2 It's the number of seconds which have passed since 01/01/1970. You can use the FROM_UNIXTIME function in MySQL to format it as a date, for example if you were to run this query: SQL: SELECT post_id, post_date, FROM_UNIXTIME(post_date) AS actual_date FROM xf_post Then you'd see some results like this: Code: post_id post_date actual_date 16 1494952293 2017-05-16 17:31:33 17 1494952377 2017-05-16 17:32:57 27 1495542683 2017-05-23 13:31:23
It's the number of seconds which have passed since 01/01/1970. You can use the FROM_UNIXTIME function in MySQL to format it as a date, for example if you were to run this query: SQL: SELECT post_id, post_date, FROM_UNIXTIME(post_date) AS actual_date FROM xf_post Then you'd see some results like this: Code: post_id post_date actual_date 16 1494952293 2017-05-16 17:31:33 17 1494952377 2017-05-16 17:32:57 27 1495542683 2017-05-23 13:31:23
BassMan Well-known member Oct 29, 2017 #4 Thank you @Chris D for explanation and @HWS for link to converter.
eva2000 Well-known member Nov 2, 2017 #5 also can convert epoch time straight from linux ssh command line using date Code: date -d @1494952293 Tue May 16 16:31:33 UTC 2017
also can convert epoch time straight from linux ssh command line using date Code: date -d @1494952293 Tue May 16 16:31:33 UTC 2017