Questions tagged [datetime-parsing]

423 questions
0
votes
3 answers

Parse date with specific format in python

how would you go about parsing a date like that in python: Monday, April 1st I've tried datetime_object = datetime.strptime(date.replace("st","").replace("rd","").replace("th","").replace("nd","").strip(), '%A, %B %d') But obviously it…
fricadelle
  • 511
  • 1
  • 8
  • 26
0
votes
3 answers

Error while parsing date when input has non-date numeric values

I am parsing date from a pdf document that has other date-like formats Traceback (most recent call last): File "/Users/akjain/Documents/workspace/Parse13F/13FParser.py", line 26, in print dparser.parse(' Crl. A. Nos. 291/16, 300/16,…
0
votes
1 answer

Converting specific string to Date using SimpleDateFormat

I have this string I want to convert to a java Date object: "Mon Jun 12 2017 21:00:15 GMT+0200 (W. Europe Summer Time)" The first thing I do is splitting the string before the first '(' then removing any trailing spaces so I'm left with: "Mon Jun…
Luminai
  • 29
  • 1
  • 1
  • 8
0
votes
4 answers

Getting wrong date when I am trying to parse actual date

My actual date format is: Saturday, June 10 11:18 AM I want to convert this format to yyyy-MM-dd HH:mm:ss. For that I am trying to parse input string using below code: SimpleDateFormat format = new SimpleDateFormat("EEEE, MMMM dd HH:mm aa",…
malli
  • 642
  • 2
  • 12
  • 30
0
votes
1 answer

Parsing mysql date to ZonedDateTime

I'm trying to parse data coming from MySql in the following format: DATE_FORMAT(datetime,'%m-%d-%Y %H:%i') Java parser code looks like this: ZonedDateTime datetime = ZonedDateTime .parse( …
AnKing
  • 1,994
  • 6
  • 31
  • 54
0
votes
3 answers

How can i convert the string value to date time value and assign it to DateTimePicker

I stored a date value and retrieve it and the format of the date in the string is yyMMdd. Now when the user loads that from the string i would like to select the DateTimePicker as the user loaded date. Sample code: string strDate =…
Developer
  • 8,390
  • 41
  • 129
  • 238
0
votes
2 answers

Entity framework "Select date time from string"

I need to select the records from a table for date interval. But the date to select from is kept as nvarchar in this pattern 20160511_155015 (yyyymmdd_hhmmss) I cannot use ToList() to make it as DateTime.ParseExact(entry.StartDate,…
Roman
  • 665
  • 1
  • 9
  • 24
0
votes
1 answer

Using ViewState string was not recognized as a valid datetime

DateTime sStartDate = DateTime.Parse(Convert.ToString(ViewState["StartDate"])); string sEndDate1 = Convert.ToString(ViewState["EndDate"]); DateTime sEndDate = DateTime.ParseExact(sEndDate1, "dd/MM/yyyy hh:mm:ss",…
0
votes
1 answer

Error converting between dateformats in c#

I have the following data in my date field of my GridView: 2016-01-24T00:00:00 Before updating that field, I want to store that value in "dd/MM/yyyy" format. To do that I'm doing the following: IFormatProvider culture = new…
gene
  • 2,098
  • 7
  • 40
  • 98
0
votes
1 answer

If string contains “T” then remove. After this concat with a time string to form a date within a automapper file

I have two strings. A date string and a time string, these need to be concatenated together to form a valid datetime. The below code works but looks a bit messy and a bit like a hack, is there a better way? .ForMember(dest => dest.ValidFrom, src =>…
Clare Barrington
  • 1,135
  • 1
  • 11
  • 28
0
votes
1 answer

Parsing date from string using dateutil parser

I am trying to parse date which have string format as u'June 11, 2015 - 12:26 hrs IST' but when I am using dateutil parser to parse I am getting error. from dateutil.parser import parse parse("u'June 11, 2015 - 12:26 hrs IST'") Here is the…
Rahul
  • 2,056
  • 1
  • 21
  • 37
0
votes
3 answers

C# MySqlCommand Insert shows fatal error command

I have a table (Horario) with the following types: id (int, auto increment) codMedico (int) dia (Date) horarioInicio (Time) horarioFim (Time) status_id (int) I can't see any problem on the code below, but it just shows me "fatal error" on…
0
votes
2 answers

DateTime parsing not working in Windows 7: The string was not recognized as a valid DateTime

Before i begin to explain ,i need to tell I have tried all the possible solutions for this problem that are provided in stackoverflow. But doesn't work in windows 7. On windows 7 parsing datetime is not working. i have tried the following code…
0
votes
1 answer

How can I parse parse date with time and miliseconds in Python?

I want to convert a datestring into another date format. The datestring 2014-11-20T00:00:00.000Z The code datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%S%Z').strftime('%Y%m%d') The error time data '2014-11-20T00:00:00.000Z' does not match…
Rooterle
  • 373
  • 1
  • 4
  • 12
0
votes
3 answers

Getting error : String was not recognized as a valid DateTime in c#

Getting error like : An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: String was not recognized as a valid DateTime. I am using this code : string datetime =…
Jatin Gadhiya
  • 1,955
  • 5
  • 23
  • 42