Turning Off Timestamp Formatting in MySQL -


I have several timestamp columns that I need to use with mixed time zones. Users are set to set the time zone in the language that I am using for front-end so that I need a MySQL to return UNIX timestamps from a selective *. Is there a way to stop auto formatting while retrieving data from the MySQL timestamp column?

YYYY-MM-DD HH: MM: SS timestamp column in MySQL Is the default representation for I do not believe you can change it at a global level.

Two options:

  1. One SELECT * , SELECT *, UNIX_TIMESTAMP (your_timestamp_column) your_temstamp In the form, which will add a unix-formatted your_timestamp column for the result.

  2. Create a view for each table () that does the same thing, for example

      select your website *, select UNIX_TIMESTAMP ( Your_timestamp_column) as your_unix_timestamp your_table; You can  SELECT * your_view  and get your UNIX timestamp without adding your questions. 

Reference:


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -