Date Format
Moderator: davidyin
Date Format
Is there any way to change the date format returned from calendar.asp to non US? i.e. dd/mm/yy. I've had a look around and gather this is an issue with Java IsDate(), but I don't know enough to change it.
-
- Members
- Posts: 3
- Joined: Fri Sep 07, 2018 2:19 am
Re: Date Format
DateFormat originalFormat = new SimpleDateFormat("MMMM dd, yyyy", Locale.ENGLISH);
DateFormat targetFormat = new SimpleDateFormat("yyyyMMdd");
Date date = originalFormat.parse("August 21, 2012");
String formattedDate = targetFormat.format(date); // 20120821
Also note that parse takes a String, not a Date object, which is already parsed.
-
- Members
- Posts: 3
- Joined: Fri Sep 07, 2018 2:19 am
Re: Date Format
Convert text dates by using the DATEVALUE function. To convert a text date in a cell to a serial number, use the DATEVALUE function. Then copy the formula, select the cells that contain the text dates, and use Paste Special to apply a date format to them.
Re: Date Format
Is the DATEVALUE function the only way to go about this?