Questions tagged [datetime-parsing]

423 questions
3
votes
2 answers

" java.text.ParseException: Unparseable date: "18,June 2017, 5:39AM"

I have a date in string and values like "18,June 2017, 5:39AM" and "01,July 2017, 9:09AM". Now I want to convert these dates to "2017-06-18 18:47:17" in this format . I have use this code: String testDate = "18,June 2017, 5:39AM"; SimpleDateFormat…
Anuj Dhiman
  • 1,550
  • 3
  • 26
  • 51
3
votes
2 answers

Parse nano seconds with less than 6 digits

I have the Timestamp 2017-07-25 16:19:59.89384 I want to parse it with: DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS"); LocalDate time = LocalDateTime.parse(timeStamp, formatter); But I get a…
MaxPower
  • 881
  • 1
  • 8
  • 25
3
votes
3 answers

Trying to parse a datetime in PDT to a ZonedDateTime representation

How should I parse this datetime value that is in the PDT timezone? 06/24/2017 07:00 AM (PDT) I want to maintain the timezone so that I can then represent the time in other timezones depending on the website visitors preferences. I tried using…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
3
votes
2 answers

How to handle all Zone Offset in one DateTimeFormater Java 8

I need to create a DateTimeFormatter for the following valid dates. String date1 = "2017-06-20T17:25:28"; String date2 = "2017-06-20T17:25:28.477777"; String date3 = "2017-06-20T17:25:28.477777Z"; String date4 =…
Amit Garg
  • 838
  • 1
  • 10
  • 21
3
votes
1 answer

Android converting date time parse error (even tried joda time)

I'm parsing a number of news feeds and each item's pubDate follows the same format: Sun, 11 Jun 2017 18:18:23 +0000 Unfortunately one feed does not: Sat, 10 Jun 2017 12:49:45 EST I have tried to parse the date with no luck using androids java…
JakeB
  • 2,043
  • 3
  • 12
  • 19
3
votes
3 answers

java.text.ParseException: Unparseable date: java.text.DateFormat.parse(DateFormat.java:579)

I have problem with SimpleDateFormat. SimpleDateFormat dtfmt=new SimpleDateFormat("dd MMM yyyy hh:mm a", Locale.getDefault()); Date dt=dtfmt.parse(deptdt); In Android Emulator works fine but in phone I have this error: W/System.err:…
Piotr
  • 31
  • 1
  • 3
3
votes
5 answers

A respectable PHP Datetime parser

echo date('r',strtotime("16 Dec, 2010")); //Tue, 16 Dec 2008 20:10:00 +0530 echo date('r',strtotime("16 Dec 2010")); //Sat, 16 Jan 2010 00:00:00 +0530 That's just wrong... Either it should fail or it should parse correctly. Do you know any…
anshul
  • 5,945
  • 5
  • 24
  • 29
3
votes
2 answers

Python parsing date with strptime

I have url that returns date in this format url_date = "2015-01-12T08:43:02Z" I don't know why there are strings, it would have been simpler to get it as "2015-01-1208:43:02" which would have been simpler to parse using…
arbi-g11324115
  • 193
  • 1
  • 2
  • 13
3
votes
2 answers

How to Sum N values in time format (hh:mm:ss)?

I used date_parse function and added some time values. print_r(date_parse("23:00:00")); $parsed = date_parse($totdh); $seconds = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second']; $TotDownMinutes = $seconds / 60; i had problem…
J Ramesh Fernandez
  • 309
  • 1
  • 8
  • 22
3
votes
2 answers

Convert 14 number to DateTime in C#

I have a 14 number with 2 characters of AM/PM, I want to convert them to dateTime for example: 515201483742AM I tried this code: DateTime result = DateTime.ParseExact(dateString, "Mdyyyyhmmsstt", CultureInfo.CreateSpecificCulture("en-US")); the…
M.Ghandour
  • 93
  • 2
  • 12
3
votes
1 answer

parsing a Datetime with AM/PM identifier

I am needing to parse Oct 3, 2014 10:05 a.m. I'm familiar with using the DateTime.TryParseExact() using the TT expression for the AM or PM. However modifying it to T.T. does not successfully parse the string into a DateTime. Here's the code I…
shadonar
  • 1,114
  • 3
  • 16
  • 40
3
votes
2 answers

What does dashes mean in ISO 8601 date and time format?

What does dashes mean in ISO 8601 date and time format? --0412 --1022T1410 ---12 Is it current year and month, some "minimum" year or anything else? If its a current year, does this means I can not represent it in DateTimeOffset object in .Net…
IT Hit WebDAV
  • 5,652
  • 12
  • 61
  • 98
3
votes
1 answer

Parse TextBox to SqlDbType.Date as "dd.MM.yyyy"

I want dates to look on page like dd.MM.yyyy. Me like this way, which is culture-independent. I don't know how make it right. cmd.Parameters.Add("@eventdate", SqlDbType.Date).Value = dateAddTxtBox.Text; Format Exception: String was not recognized…
master-lame-master
  • 3,101
  • 2
  • 30
  • 47
3
votes
3 answers

Populating DateTime object with this string 03-06-2012 08:00 am

How to populate C# DateTime object from this "03-06-2012 08:00 am" string. I'm trying some code of follwoing type: DateTime lectureTime = DateTime.Parse("03-06-2012 08:00 am"); I am using jQuery based this…
Abhi
  • 5,501
  • 17
  • 78
  • 133
3
votes
2 answers

parsed date format hard to convert

I parse a date that is in string format and would like to convert it to a datetime format but cannot figure out how to do this. The date appears as such; Wed April 18 08:00:04 +08:00 2012 and would like it in a simple form of 2012-04-18 08:00:00…
vbNewbie
  • 3,291
  • 15
  • 71
  • 155