M
Meryk
Guest
Hi Siraj, Well I managed to do this differently : I am building the String we are using in the select Query manually, by getting the UTC year, month, day, hour, minute and second, from the User date. Here is the code : function buildingUTCString(date){ var year = date.getFullYear(); var month = date.getUTCMonth() + 1; var day = date.getUTCDate(); var hour = date.getUTCHours(); var minute = date.getUTCMinutes(); var second = date.getUTCSeconds(); if(month < 10){ month = '0'+ month; } if(day < 10){ day = '0' + day; } if(hour < 10){ hour = '0' + hour; } if(minute <10){ minute = '0' + minute; } if(second < 10){ second = '0' + second; } var dateString = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; return dateString; } It is easier to do this than get the offset and calculate the date again... One thing, is this format "yyyy-MM-dd HH:mm:ss", any likely to change ? Or are the date fields always going to be stored in this specific format in the DB? Thank you Meryem
Continue reading...
Continue reading...