We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unix Timestamps

Thread ID:

Created:

Updated:

Platform:

Replies:

131066 Jun 14,2017 11:13 PM UTC May 14,2018 10:52 AM UTC Dashboard Platform 7
loading
Tags: Dashboard Datasources
Eric Kok
Asked On June 14, 2017 11:13 PM UTC

What is the most effective way of converting those into usable dates? I have a ton of them.

Eric


Vinoth Srinivasan [Syncfusion]
Replied On June 15, 2017 07:25 AM UTC

Hi Eric 
 
Thanks for your interest in Syncfusion Components. 
 
You can convert the Unix TimeStamps values as Date values using the following expression in our report designer. 
 
=DateAdd("s",Fields!TimeStamp.Value,"1970-01-01 00:00:00") 
 
We have prepared a sample report based on this and it can be downloaded from the following location. 
 
Also, please refer the below MSDN forum for more details. 
 
Regards, 
Vinoth S. 


Eric Kok
Replied On June 16, 2017 08:56 PM UTC

Vinoth, 

My posting was not complete, I guess. I am using the Dashboard Designer. I don't seem to have the option to use the DateAdd formula anywhere. Am I overlooking something?

Eric 

Umapathy Shanmugam [Syncfusion]
Replied On June 19, 2017 08:58 AM UTC

Hi Eric, 
 
Thanks for your reply.  
 
Could you please let us know the following details, so that we can understand your query better and provide a solution. 
  1. Connection type which you are using.
  2. Are you expecting to convert the string column which is in date format to date time column.
  3. Provide some details about your requirement.
 
If you need to convert your string column to date time column in your dropped table we have “Change column type” option in column settings. Please refer to the below link to know more about handling column type conversion in our dashboard application.  
 
Regards, 
Umapathy S. 


Eric Kok
Replied On June 19, 2017 09:51 AM UTC

  1. Connection type is ODBC.
  2. Are you expecting to convert the string column which is in date format to date time column. The content is a UNIX timestamp, so the system sees it as a number and I would like to convert it somehow to a date. E.g.: Timestamp: 1497855166
  3. I would like to use those timestamps as date in the Dashboards. 

Umapathy Shanmugam [Syncfusion]
Replied On June 20, 2017 07:34 AM UTC

Hi Eric, 
 
Thank you for sharing the requested details.  
 
We assumed that you are using MySQL as ODBC server type and follow the below steps to convert UNIX timestamp as date through expression designer window.  
 
Create expression like below to convert UNIX timestamp to date.  
 
S.No 
Expression Name 
Expression 
Comments 
Expression1 
FROM_UNIXTIME('1497855166') 
Convert 1497855166 this time stamp value as date 
Expression2 
FROM_UNIXTIME([UnixTimeStampColumn]) 
Convert UnixTimeStampColumn value as date 
 
Now both Expression1 and Expression2 will act as date field and we can use it in widgets. Please refer the below link to know more about expression creation.  
 
Please do let us know if you required any other assistance.  
Regards, 
Umapathy S. 


Alexey Dovgan
Replied On May 11, 2018 07:56 AM UTC

This is does not work with REST Web Data Source.


Anandaraj Radhakrishnan [Syncfusion]
Replied On May 14, 2018 10:52 AM UTC

Hi Alexey, 
 
Mentioned conversion process in our previous reply of this forum was particularly suggested for ODBC MySQL data source and it won’t work for web data source. So, we are suggesting you to use the below provided expression for web data source.  
 
Create expression like below to convert UNIX timestamp to date.    
 
S.No  
Expression Name  
Expression  
Comments  
1 
Expression1  
datetime('1497855166','unixepoch', 'localtime') 
Convert 1497855166 this time stamp value as date  
2 
Expression2  
datetime([UnixTimeStampColumn],'unixepoch', 'localtime') 
Convert UnixTimeStampColumn value as date  
  
Now both Expression1 and Expression2 will act as date field and then we can use it in widgets. Please refer the below link to know more about expression creation.   
  
Please do let us know if you require any further assistance.   
 
Regards,
Anandaraj R
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;