Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Converted actual UTC time is outputing incorrectly 1 month ahead of actual time

    In the mysql db, the last_mod_datetime value is correct. No timezone config issues. Can somebody tell me what is wrong with my conversion function "getLastDateMod" above where the output is adding 1 month to the actual date?

    function getLastDateMod(_date){
    var ret = "";
    if (_date){
    ret = _date.formatToDate("yyyy-MM-ddTHH:mm:ss[\+,\-][0-9][0-9]?:[0-9][0-9]?").format("MM/dd/yyyy HH:mm");
    }else{
    ret = "";
    }
    return ret ;
    }

    Additional code:
    name: getLocaleAttribute(RS_METADATATEMPLATES, "TXT_last_modified", "METADATATEMPLATES"),
    canResize: true,
    canSort: true,
    sortField: "last_mod_datetime",
    field: "lastModifyTime",
    formatter : getLastDateMod,
    width: '20%'

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,149
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Months in Javascript are 0 (January) -11 (December).

    Quizmaster: Since 1920 a statue of which former US President has resided in Parliament Square?
    Contestant: Ronald Reagan

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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