Results 1 to 7 of 7

Thread: hHow to convert date that is coming in this format Tue Aug 30 2016 00:00:00 GMT-0300

  1. #1
    Sencha User
    Join Date
    Apr 2015
    Posts
    18
    Answers
    1

    Default hHow to convert date that is coming in this format Tue Aug 30 2016 00:00:00 GMT-0300

    I have a field of type Date , which is coming in a very strange shape and I can not format it

    Code:
    fields: [        'casa',
            'esporte',
            {name: 'dateEvent', 
              convert: function(date) {  //-> Tue Aug 30 2016 00:00:00 GMT-0300 (Hora oficial do Brasil) {}
                var x = Ext.Date.parse(date, "Y-m-d g:i:s A");  //-> x = null :(
                return new Date(x);
              }},
            'mandante',
            'visitante'],
    I need to convert to the following format :

    Code:
    "yyyy-MM-dd'T'HH:mm:ss.SSS"
    ty.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    Is it a string or a date instance?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Apr 2015
    Posts
    18
    Answers
    1

    Default

    my java server , is receiving this format:
    Code:
    Tue Aug 30 2016 00:00:00 GMT-0300 (Hora oficial do Brasil)
    String and Jackson is not serializing this date in this format =/

  4. #4
    Sencha User
    Join Date
    Apr 2015
    Posts
    18
    Answers
    1

    Default

    the server will instantiate an object with Java.Util.Date, but in this format causes error

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    Your question isn't clear. Are you saying you need to format the date when sending it from the client to the server?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #6
    Sencha User
    Join Date
    Apr 2015
    Posts
    18
    Answers
    1

    Default


    yes, I am trying to send data to the server, but this format with " (official time of Brazil) " is not accepted by the server , and I do not know how to remove it

  7. #7
    Sencha User
    Join Date
    Apr 2013
    Posts
    913
    Answers
    105

    Default

    You might want to use serialize instead of convert.

Similar Threads

  1. Replies: 3
    Last Post: 31 Jul 2012, 4:50 PM
  2. Replies: 2
    Last Post: 3 Apr 2012, 8:15 AM
  3. Convert date in UTC format before submitting to server
    By coooolmagic in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 9 Mar 2011, 4:51 AM
  4. convert mysql datetime to date format
    By rich71 in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 21 Jul 2010, 8:16 PM
  5. Replies: 0
    Last Post: 21 Feb 2009, 11:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •