- Who to extract data with respect to date?
- How to see timestamp in Date format or in Time format (for ex dd/mm/yyyy hh:mm)?
If you are running an SQL query, you have the ability to reconfigure the appearance of the date to whatever you wish.
How are you extracting the date? In a SQL query or in a plugin?
For SQL, try something like:
DATEADD(s, mdl_your_table.timecreated, '19700101 00:00:00:000') AS yourdate
or
CAST(DATEADD(s,mdl_your_table.timecreated,'19700101 00:00:00:000') AS date) AS yourdate
For SQL, try something like:
DATEADD(s, mdl_your_table.timecreated, '19700101 00:00:00:000') AS yourdate
or
CAST(DATEADD(s,mdl_your_table.timecreated,'19700101 00:00:00:000') AS date) AS yourdate
The "19700101 00:00:00:000" should reflect your own timezone - i.e. UTC + or - X hours.
If you're using MySQL then you could always use UNIX_TIMESTAMP() instead of DATEADD()...
If you're using MySQL then you could always use UNIX_TIMESTAMP() instead of DATEADD()...
Adding ‘from_unixtime’ to that part of the query also works…
I like using this form of the SQL command that puts the date into a format that Excel likes.
from_unixtime(timeopen, "%m/%d/%Y %h:%i:%s %p")
from_unixtime(timeopen, "%m/%d/%Y %h:%i:%s %p")