datetime-parsing Questions

1

Solved

I am currently working with Java's DateTimeFormatter to parse ISO 8601 formatted timestamps, particularly those containing fractional seconds. While experimenting with different timestamp formats, ...

3

Solved

My MCVE (as a TestNG unit test): public class MyDateTimeFormatterTest { private static final String BASE_PATTERN = "yyyy/MM/dd HH:mm:ss"; private static final DateTimeFormatter FORMATTER = Dat...
Notochord asked 7/5, 2015 at 2:3

8

Solved

I am able to parse strings containing date/time with time.strptime >>> import time >>> time.strptime('30/03/09 16:31:32', '%d/%m/%y %H:%M:%S') (2009, 3, 30, 16, 31, 32, 0, 89, -1...
Enslave asked 30/3, 2009 at 17:36

3

Solved

I'm trying to figure-out the right string format of the following given date-time literal: 18-JUN-13 12.17.36.000000000 Using MSDN, I managed to composed the following format: "d'-'MMM'-'y'T'h'...
Credulous asked 9/2, 2015 at 12:17

28

I need to parse RFC 3339 strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type. I have found strptime in the Python standard library, but it is not very convenient. What ...
Dynamite asked 24/9, 2008 at 15:17

4

Solved

I will be asking a user to enter a specific time: 10AM, 12:30PM, 2:47PM, 1:09AM, 5PM, etc. I will be using a Scanner to get the user's input. How can I parse/convert that String to a LocalTime ob...
Williamwilliams asked 9/8, 2017 at 15:41

7

Solved

Am using Java 1.7. Trying to convert: 2018-05-23T23:18:31.000Z into 2018-05-23 23:18:31 DateUtils class: public class DateUtils { public static String convertToNewFormat(String dateStr)...
Parsons asked 23/5, 2018 at 23:42

6

Solved

Here is my method to parse String into LocalDateTime. public static String formatDate(final String date) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS"); L...

4

Solved

Is there a way how to create JSR-310 formatter that is able to parse both following date/times with variable length of seconds fraction? 2015-05-07 13:20:22.276052 or 2015-05-07 13:20:22.276 ...
Fibroblast asked 7/5, 2015 at 13:52

7

Solved

How do I create a DateTime var from a string which is already adjusted for UTC? I am running this on a machine set to BST (GMT+1). If I run the following line of code: DateTime clientsideProfileSy...
Amadus asked 20/5, 2011 at 15:0

2

Solved

I have a problem with parsing ZonedDateTime: DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-ddzhh:mm"); ZonedDateTime.parse(s, formatter); This results in an error: java...

1

In Java the Locale defines things that are related how people want to see things (like currency formats, the name of the months and when a week starts). When parsing the name of a Month (with a Dat...
Thunderhead asked 31/1, 2022 at 15:49

6

Solved

I have to parse a date and time string of format "2015-01-16 22:15:00". I want to parse this into JavaScript Date Object. Any help on this? I tried some jquery plugins, moment.js, date.js, xdate.j...
Weighty asked 17/1, 2015 at 17:38

5

Solved

I am having trouble using java's LocalTime to parse a string with hours, minutes, and seconds. LocalTime t = LocalTime.parse("8:30:17"); // Simplification This throws the following exception: ...
Egalitarian asked 11/4, 2020 at 15:11

5

Solved

The expression OffsetDateTime.parse("2016-08-24T18:38:05.507+0000") results in the following error: java.time.format.DateTimeParseException: Text '2016-08-24T18:38:05.507+0000' could not be pa...
Murky asked 24/8, 2016 at 22:14

4

Solved

I have a formatted date from sqllite database, to use this in a graph view I need to format it in a long number. The format is: 2012-07-11 10:55:21 how can I convert it to milliseconds?
Sprig asked 11/7, 2012 at 16:13

3

Solved

My program is parsing an input string to a LocalDate object. For most of the time the string looks like 30.03.2014, but occasionally it looks like 3/30/2014. Depending on which, I need to use a dif...
Afterword asked 6/5, 2014 at 7:39

7

Solved

What's the nicest way to parse a date that can be in one of the following formats "dd-MM-yyyy HH:mm" "dd/MM/yyyy HH:mm" "dd.MM.yyyy HH:mm" without creating 3 SimpleDateFormats and parsing ag...
Underbodice asked 18/9, 2009 at 9:23

3

Solved

I get this error with this code: SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd MMMM HH:mm yyyy",myDateFormatSymbols); sdf.parse("понеділок 12 квітень 07:00 2021"); Whis ...
Tragopan asked 9/4, 2021 at 22:14

3

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 ...
Mantelpiece asked 13/10, 2016 at 15:46

5

I tried to use DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH); LocalDate date = LocalDate.parse(d.toString(), formatter); but i...
Epley asked 29/7, 2020 at 15:21

6

When I try to run the following code: LocalTime test = LocalTime.parse("8:00am", DateTimeFormatter.ofPattern("hh:mma")); I get this: Exception in thread "main" java.time.format.DateTimeParseExc...
Taboo asked 29/9, 2017 at 1:34

5

Solved

I'd like a way to show natural times for dated items in Python. Similar to how Twitter will show a message from "a moment ago", "a few minutes ago", "two hours ago", "three days ago", etc. Django ...
Unprepared asked 4/1, 2009 at 1:20

5

Solved

I am trying to parse a String (YYYY-MM-dd HH:mm) to Date, however getting wrong date than expected. CODE: Date newDate = null; String dateTime = "2013-03-18 08:30"; SimpleDateFormat df = new Simp...
Rockaway asked 10/4, 2013 at 4:28

1

Solved

I'd like to parse the expiration date (exp) from a JSON Web Token (JWT) without verifying it. I've tried the following script (in an attempt to follow How to parse unix timestamp to time.Time): pa...
Welbie asked 17/10, 2019 at 22:36

© 2022 - 2024 — McMap. All rights reserved.