Hello and welcome to our community! Is this your first visit?
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
    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");
    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. #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,704 Times in 2,680 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