Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2013, 03:50 PM   PM User | #1
ezyu2
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ezyu2 is an unknown quantity at this point
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%'
ezyu2 is offline   Reply With Quote
Old 01-17-2013, 06:38 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:31 AM.


Advertisement
Log in to turn off these ads.