Date Format

Basic Installation and Setup.

Moderator: davidyin

Post Reply
ormond
Members
Members
Posts: 3
Joined: Tue Feb 03, 2009 9:19 pm

Date Format

Post by ormond »

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.
FrankHolcomb
Members
Members
Posts: 3
Joined: Fri Sep 07, 2018 2:19 am

Re: Date Format

Post by FrankHolcomb »

ormond wrote: Tue Feb 10, 2009 1:38 pm 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.
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.
FrankHolcomb
Members
Members
Posts: 3
Joined: Fri Sep 07, 2018 2:19 am

Re: Date Format

Post by FrankHolcomb »

ormond wrote: Tue Feb 10, 2009 1:38 pm 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.
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.
JosephDon
Newbie
Newbie
Posts: 1
Joined: Wed Feb 13, 2019 1:48 am

Re: Date Format

Post by JosephDon »

Is the DATEVALUE function the only way to go about this?
Post Reply