Questions tagged [datetime-parsing]

423 questions
-1
votes
2 answers

DateTime.TryParse not working in Internet Explorer

public JsonResult TimeValidation(string pickUp, string delivery) { var errorMessage = string.Empty; var dateTime = DateTime.MinValue; if (!DateTime.TryParse(pickUp, out dateTime)) errorMessage = "Invalid date"; if…
-1
votes
3 answers

How to Parse a date string from a text file on PC to DateTime

---EDITED--- I have a simple C# Windows Form. "c:\date.txt" is just (DateTime.Now). Later I will create some code to update this file, but for now, I'm having a problem with debugging. It builds fine, but debug throws an exception at the date.txt…
Fixer
  • 23
  • 1
  • 8
-1
votes
3 answers

Get DateTime from a string

I have some strings with DateTime and some without. I have to find out if each of strings contains DateTime. Please help me with it. String examples (in Russian): 13 сентября 2013 г., 11:27 пользователь написал: 13 сентября…
-1
votes
2 answers

How do I convert DateTime to another format?

From a weather feed I'm getting the data for dates in the form of 2012-05-17. How do I convert that to Thursday May 17th form?
webewitch
  • 89
  • 4
  • 10
-2
votes
0 answers

How would I convert some string dates to ZonedDateTime

I'm trying to perform a simple conversion from a set of date strings to ZonedDateFormat: String dateString = "2034-09-03T00:00:00Z"; String date2String = "2023-01-20T13:45:24.548Z"; Parsing with the ZonedDateFormat works with the decimals but…
lil chogomo
  • 41
  • 1
  • 1
  • 6
-2
votes
1 answer

Cannot parse '12/16/2022, 1:33 pm' using 'M/d/yyyy, h:mm a' format pattern into a LocalDateTime object

The value 12/16/2022, 1:33 pm looks to match to expected format pattern M/d/yyyy, h:mm a, what is incorrect at index 17? Java unit test: @Test public void testLocalDateTime_shortDateTimePattern() { String pattern = "M/d/yyyy, h:mm a"; …
bobbyrne01
  • 6,295
  • 19
  • 80
  • 150
-2
votes
2 answers

What is wrong with this java date formatter?

I'm trying to format the date you see as a String in the below code, to be able to have it as a LocalDateTime object, but I'm getting an exception, I'm following this guide https://mkyong.com/java8/java-8-how-to-convert-string-to-localdate/, but…
-2
votes
1 answer

How can we achieve Date splits/Break in dates in Java

Here Java need to read a file which has Contract, Member, Start-Date and End-Date. If there are date split/break in dates it need to be populated in a target file at contract level. Below provided the Source file and Target file example and the…
-2
votes
3 answers

Parse UTC time format into readable datetime in android

I have an UTC datetime in the format 2019-12-06T06:04:50.022461Z I want to convert into readable datetime in the format dd-mm-yyyy hh:mm:ss. I am not able to convert in the particular format. Any help will be highly appreciated. Thanks
Piyush
  • 492
  • 5
  • 22
-2
votes
1 answer

Count number between two date (C#, CultureInfo)

I trying to get Number between 2 dates: DateTime base; .... base = DateTime.ParseExact(pos[13], "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture); //example base = 2014-06-21 17:00:00 DateTime col_N; //then some for loop col_N =…
4est
  • 3,010
  • 6
  • 41
  • 63
-2
votes
2 answers

How do i split the date from the string of date-time with time zone?

I have a date-time string with time zone like "2019-05-21 04:49:39.000Z" this. How do i split the date from this string without split method.I have to use the time zone formatter. Anyone please help me in it.
-2
votes
1 answer

String of format 2018-11-26T15:12:03.000-0800 to java.time.localdatetime of format "M/dd/yy HH:mm:ss a z" conversion throwing exception

i wrote an util function to convert a string time value of format 2018-11-26T15:12:03.000-0800 to localdatetime of format "M/dd/yy HH:mm:ss a z" string of format 2018-11-26T15:12:03.000-0800 to java.time.localdatetime of format "M/dd/yy HH:mm:ss a…
-2
votes
1 answer

how to convert from 10-JUN-02 01.57.07.848594000 PM to yyyy-MM-dd-HH24.MI.SS.FF6 in java

how to convert from 10-JUN-02 01.57.07.848594000 PM to yyyy-MM-dd-HH24.MI.SS.FF6 in java
kari
  • 1
-2
votes
1 answer

Getting an error as Unparseable date: " " while using formatter.parse()

I am taking the date as input from JSP and then I need to store in the database using hibernate. my date format is also correct but still, it's not working. Here is my code: String dateStr = request.getParameter("receive_date"); DateFormat…
-2
votes
5 answers

ParseException when parsing 3 character abbreviated month using SimpleDateFormat

Here is my code, SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); Date dft = (Date) format.parse("16-MAY-2018 09:30:22:000"); I am getting below exception java.text.ParseException: Unparseable date: "16-MAY-2018…