[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

Parse DateTime to Date

How do you parse a DATETIME to DATE

06/04/2013 13:12:13 PM


TO


06/04/2013
0
JElster
Asked:
JElster
2 Solutions
 
Kyle AbrahamsSenior .Net DeveloperCommented:
function formatDate(value)
{
   return value.getMonth()+1 + "/" + value.getDate() + "/" + value.getFullYear();
}
0
 
JElsterAuthor Commented:
string is not a function.. what am I doing wrong

return formatDate(val);
0
 
GaryCommented:
myDate="06/04/2013 13:12:13 PM";

myDate=myDate.split(" ")[0];

alert(myDate)

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now