- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2014 07:01 PM
In Client Script, how can I compare 2 dates(with time) that are in different format.
ex yyyy-mm-dd HH:mm:ss and MM-dd-yyyy hh:mm:ss (12 hours)
Somehow I need to convert the 2nd date&time to system format and then compare to the first date. But I do not know how. Please assist.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 06:55 AM
Using "getDisplayValue()" will retrieve the date/time in the person's timezone and display format. So you could use that on both date variables to force them into the same timezone.
gdate.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 10:38 AM
Check out john.roberts's post about comparing dates in client scripts - Comparing Client Dates
The compareDates function takes in the format for both dates as parameters so you should not have to convert them first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2014 11:41 AM
Did that answer your question? If so, can you mark the response as the Correct Answer so other users know this was a valid solution. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2014 11:56 AM
Thanks Jim for the link. It helped however, the numeric value of the dates are not the same because of the different timezone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2014 01:05 PM
OK, so not only different formats, but you have different timezones to deal with as well?