Hi,
Date formatting using
method, formats it with the hours begin from 0 AM to 12 pm. According to SimpleDateFormat java API [1], "h" stands for "Hour in am/pm (1-12)".
Example:
logs
whereas equivalent code in Java:
logs:
Tested with ISC_100_BRANCH_2015-01-19_1421661957_wayne_limegreen-dev-server
[1] http://docs.oracle.com/javase/7/docs...ateFormat.html
Date formatting using
Code:
DateUtil.format(date, 'hh:mm a')
Example:
Code:
console.log(isc.DateUtil.format(new Date('Wed Jan 07 2015 00:00:00'), 'hh:mma')); console.log(isc.DateUtil.format(new Date('Wed Jan 07 2015 12:00:00'), 'hh:mma'));
Code:
00:00 am 12:00 am
Code:
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); System.out.println(new SimpleDateFormat("hh:mm a").format(sdf.parse("00:00"))); System.out.println(new SimpleDateFormat("hh:mm a").format(sdf.parse("12:00")));
Code:
12:00 AM 12:00 PM
Tested with ISC_100_BRANCH_2015-01-19_1421661957_wayne_limegreen-dev-server
[1] http://docs.oracle.com/javase/7/docs...ateFormat.html
Comment