• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • Last Modified:

Parse String to date error

Hi I am passing in a local date from javascript in the fomat 31/8/2012 11:29:19

But when I try to convert it into a valid date on the server side I get the error message "Date is not a recognised format"

My code is ........

Dim british = New CultureInfo("en-GB")
            Dim _localDate As Date = DateTime.ParseExact(localDate, "dd/MM/yyyy HH:mm:ss", british)


Would be grateful for any help.

Thanks
0
Soluga
Asked:
Soluga
  • 3
1 Solution
 
CodeCruiserCommented:
Have you tried with

Dim _localDate As Date = DateTime.ParseExact(localDate, "dd/M/yyyy HH:mm:ss", british)
0
 
SolugaAuthor Commented:
Same error!
0
 
SolugaAuthor Commented:
This works....

Dim _localDate As Date = Convert.ToDateTime(localDate)
0
 
SolugaAuthor Commented:
good
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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