Carlos Martins Posted February 4, 2018 Share Posted February 4, 2018 Hi everyone! I'm having trouble editing the "order_date" field ...what format is this? "1517740505" is listed on Admin > Costumers >Orders as "Today, 10:35" , how?? I need to create Order via Admin panel with specific dates other than the current date/time, how can I do it? Thanks in advance, Carlos Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4, 2018 Share Posted February 4, 2018 (edited) Welcome Carlos Martins! Glad to see you made it to the forums. Only two or three database columns store a date as a SQL DATE/TIME value. The other 'time'-related columns are "UNIX timestamps" - the number of seconds since Jan1,1970. There are PHP functions that take this number, and a "pattern", as arguments, and give back a phrase. The phrase can be 'fuzzy' (Yesterday, two weeks ago, etc) or absolute (4 Feb, 2018). Edited February 4, 2018 by bsmither 1 Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted February 4, 2018 Share Posted February 4, 2018 Try using https://www.epochconverter.com/ to convert back and forth between the two formats Ian 1 Quote Link to comment Share on other sites More sharing options...
Carlos Martins Posted February 4, 2018 Author Share Posted February 4, 2018 (edited) Thank you both for the quick reply! bsmither - Is there a reason why the SQL Date/Time value isn't the table field standard?Why are "UNIX timestamps" used instead? It doesn't make sense to me using two formats..... I also read this while looking for info : "Many Unix systems store epoch dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the Year 2038 problem or Y2038). " havenswift-hosting - Thank you! The Epoch Converter did the trick!! Best regards, Carlos Edited February 4, 2018 by Carlos Martins Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4, 2018 Share Posted February 4, 2018 I wonder why unix timestamps aren't the standard. PHP has so many functions that use this value. A "human-readable" DATE/TIME SQL-language column storage type (I suppose) can be used with other SQL functions in SQL queries executing in SQL database servers. I am not 100% conversant with SQL DATE/TIME data types, but it seems to me that this value represents a date/time corresponding to some timezone that may be revealed later or not. I do not know about that. I have not double-checked CubeCart's schema for integer columns used for unix timestamps for their state of being unsigned or signed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.