Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General Discussion » View Thread |
Messages 1 to 6 of 6 total |
Dataset and json date format |
Wed, Oct 3 2012 5:33 PM | Permanent Link |
Sergei Safar | Hi all,
my web server is sending dates in the following json format: YYYY-MM-DD (PHP, MySQL, jsonencode function) In EWB, Editing Dataset, tab Preview, the format is DD/MM/YYYY. Is there a way to change dataset date format? Regards Sergei Safar |
Thu, Oct 4 2012 7:28 AM | Permanent Link |
Fernando Dias Team Elevate | Sergei,
Internally a Date/Time is not formatted, it's just an integer representing the number of milliseconds since the 1st of January, 1970. Display and editing formats are controlled by an automatically created object called FormatSetting. Take a look here : http://www.elevatesoft.com/manual?action=viewcomp&id=ewb1&comp=TFormatSettings .. -- Fernando Dias [Team Elevate] |
Thu, Oct 4 2012 9:18 AM | Permanent Link |
Sergei Safar | Fernando,
thank you for your reply. Now I am trying to modify the way my webserver returns DATEs. My question is: in which format datasets in EWB expects the field date? For example, I tried the following formats (json): { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012-10-04" . . . { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012/10/04" . . . { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04-10-2012" . . . { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04/10/2012" . . . and the dataset, field DATE COLLECT, always shows (TGrid) the same strange date: 12/31/1969 Other fields of the same dataset (string, integer, boolean) are all ok. Regards, Sergei Safar "Fernando Dias" wrote: Sergei, Internally a Date/Time is not formatted, it's just an integer representing the number of milliseconds since the 1st of January, 1970. Display and editing formats are controlled by an automatically created object called FormatSetting. Take a look here : http://www.elevatesoft.com/manual?action=viewcomp&id=ewb1&comp=TFormatSettings .. -- Fernando Dias [Team Elevate] |
Thu, Oct 4 2012 9:35 AM | Permanent Link |
Raul Team Elevate | Sergei,
as per spec http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=JSON_Reference Date,TimeDate/Time Specify any valid integer value (positive or negative) for non-null values. If not null, the incoming value represents the number of milliseconds since midnight on January 1, 1970, and can be negative for time values Raul On 10/4/2012 9:18 AM, Sergei Safar wrote: > Fernando, > > thank you for your reply. Now I am trying to modify the way my webserver returns DATEs. > > My question is: in which format datasets in EWB expects the field date? > For example, I tried the following formats (json): > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012-10-04" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012/10/04" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04-10-2012" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04/10/2012" . . . > > > and the dataset, field DATE COLLECT, always shows (TGrid) the same strange date: 12/31/1969 > > Other fields of the same dataset (string, integer, boolean) are all ok. > > Regards, > Sergei Safar > |
Thu, Oct 4 2012 1:34 PM | Permanent Link |
Sergei Safar | Hi,
now I got it. Everything is ok. If someone uses MySQL/PHP as back-end the hint is: Change: SELECT `SomeDateField` FROM SomeTable To: SELECT UNIX_TIMESTAMP(`SomeDateField`) * 1000 AS 'SomeDateField' FROM SomeTable Thank you all. Regards Sergei Safar Raul wrote: Sergei, as per spec http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=JSON_Reference Date,TimeDate/Time Specify any valid integer value (positive or negative) for non-null values. If not null, the incoming value represents the number of milliseconds since midnight on January 1, 1970, and can be negative for time values Raul On 10/4/2012 9:18 AM, Sergei Safar wrote: > Fernando, > > thank you for your reply. Now I am trying to modify the way my webserver returns DATEs. > > My question is: in which format datasets in EWB expects the field date? > For example, I tried the following formats (json): > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012-10-04" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"2012/10/04" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04-10-2012" . . . > > { "rows": [{"Cod City":"BHZ","Cod TV":"02","Date Collect":"04/10/2012" . . . > > > and the dataset, field DATE COLLECT, always shows (TGrid) the same strange date: 12/31/1969 > > Other fields of the same dataset (string, integer, boolean) are all ok. > > Regards, > Sergei Safar > |
Tue, Oct 9 2012 3:58 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Sergei,
<< If someone uses MySQL/PHP as back-end the hint is: >> Nice tip, thanks very much. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |