Jump to content

Edit Order Date


Carlos Martins
 Share

Recommended Posts

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 by bsmither
  • Like 1
Link to comment
Share on other sites

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 by Carlos Martins
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...