Solved

how to convert dd/mm/yy to yy/mm/dd

Posted on 2010-11-08
5
572 Views
Last Modified: 2012-08-14
how to convert dd/mm/yy to yy/mm/dd
the date is string

thanks
0
Comment
Question by:yairab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 

Expert Comment

by:seshujosyula
ID: 34084318
You click on the date and time on the bottom right of your screen.
-> Change date and Time Settings -> Again, Change date and Time Settings ->  Change calender settings -> From the drop down for Short date; Select yyyy -mm -dd . Apply and ok.

P.S: I've checked these settings from Windows 7. Some options may differ in other operating systems.
0
 
LVL 14

Accepted Solution

by:
sam2912 earned 500 total points
ID: 34084375

function convertDate(string) {
   var date = string.split('/');
   return date[2] + "/" + date[1] + "/" + date[0];
}

Open in new window

0
 
LVL 13

Expert Comment

by:dsmile
ID: 34084415

<script language="JavaScript">
<!--
strDate= '09/02/10';
var strNewDate = strDate.substring(6,10) + '/' + strDate.substring(3,5) + '/' + strDate.substring(0,2); 
alert(strNewDate);

//-->
</script>

Open in new window

0
 
LVL 14

Expert Comment

by:sam2912
ID: 34084720
Here's the implementation. By the way, this works even if the date is without leading zeroes, i.e.: 1/1/10
<script type="text/javascript">
function convertDate(string) {
   var date = string.split('/');
   return date[2] + "/" + date[1] + "/" + date[0];
}
alert( convertDate("08/11/10") );
</script>

Open in new window

0
 
LVL 14

Expert Comment

by:sam2912
ID: 34084726
Thanks for the points!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
arrays and radio buttons 10 46
null, truthy, falsey confusion 25 43
Problem in javascript 17 57
Different Javascript on iPhone than Win 10 desktop? 7 53
This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question