511 questions
2
votes
1
answer
73
views
Why datetime.datetime.strptime %Z code doesn’t produce an aware object?
A little example:
$ python
Python 3.13.2 (main, Feb 5 2025, 08:05:21) [GCC 14.2.1 20250128] on linux
Type "help", "copyright", "credits" or "license" for more ...
1
vote
2
answers
160
views
How to efficiently convert dates in PySpark dataframe
I have a PySpark dataframe with ~70 columns and tens of millions of rows.
Each dataframe has few columns that contain dates (as strings). There are 3 possible formats of dates - "yyyyMMdd", &...
0
votes
1
answer
57
views
How do I adjust my code to parse dates with dashes?
So in Python, I'm trying to create a File checker. I have 2 inputs : filename and the pattern. The filepattern will always have the date pattern enclosed in { }
For example,
filename : File_20240621
...
-2
votes
1
answer
135
views
Possible values to be parsed using SimpleDateFormat
Sorry to ask if this is a duplicate question as I try to find solutions online but couldn't get a confirmed answer.
I would like to know the possible values that can be used to parse using ...
0
votes
0
answers
56
views
CSV file data manipulation in R
I have been trying to clean a dataset named logbook.csv. The dataset focuses on analyzing fuel usage of users Globally. The first step is to clean a column named "date_fueled" which consists ...
1
vote
1
answer
1k
views
AWS Athena - data from last 2 calendar years
would anyone be able to advise on how to bring in results from the last 2 calendar years? I'd like this to be dynamic, and show data from the current year + the previous year.
I'm currently using ...
0
votes
1
answer
92
views
ORMLite - persisting LocalDateTiime - Unparseable date
I'm using ORMLite to persist objects in an SQLite Database, but persisting LocalDateTime values does't work. I already configured a custom persister class like this:
public class ...
2
votes
2
answers
81
views
Why DOB logging every time whether updated or not during update API in Java?
I am logging fields which will be update during update API call.
But getting DOB field every time whether it is updating or not
DOB is of Date type
private Date DOB;
Logging DOB VALUE when passing ...
0
votes
1
answer
204
views
Android Unparseable date exception when try to parse date format
I try to parse this date "Wed Jul 12 2023 23:58:20 GMT+0000 (Coordinated Universal Time)"
using this code
val sdf = SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss ", Locale....
1
vote
1
answer
300
views
SimpleDateFormat("MMM d, yyyy") returns Weekday Month day 00:00:00 EDT year [duplicate]
I have a String List [Apr 1, 2019, Aug 1, 2020, Feb 20, 2018] which i need to convert to Date format in the same pattern. When Im doing it with SimpleDateFormat("MMM d, yyyy") pattern Im ...
0
votes
1
answer
68
views
Return null if incorrect date
I have many variables - year, month, day. I am trying to convert it to correct date form. I would like to get null if variables form incorrect date
var year = "2023";
var month = "11"
var day = "...
3
votes
2
answers
410
views
Parse Chinese DateTime
I'm trying to convert the following string to a DateTimeOffset
二 5月 16 14:41:40 +0800 2023
which translates to "Tue May 16 14:41:40 +0800 2023"
I have tried the following code:
...
1
vote
2
answers
795
views
How to parse a string with GMT into datetime in c#
I have this inputDateString: 15/03/2023 15:13:37 GMT and I want to convert it to datetime.
I am doing this: DateTime outputDate = DateTime.ParseExact(inputDateString, "MM/dd/yyyy:hhmmss \"...
1
vote
0
answers
62
views
Calculating if it's less than 24 hours between two dates and times in a string but I get an error java.time.format.DateTimeParseException: [duplicate]
Im trying to calculate two dates in a string if its less than 24 hours but I get an error:
java.time.format.DateTimeParseException: Text '20 4 01:40 AM' could not be parsed:
Unable to obtain ...
1
vote
3
answers
110
views
strtotime() fails to parse "00:20 AM" in datetime string
I want to format a date for SQL, but I am getting an unexpected result:
echo date('Y-m-d H:i:s', strtotime("February 13 2022 10:08 PM")); //2022-02-13 22:08:00
echo date('Y-m-d H:i:s', ...
0
votes
1
answer
121
views
Issue With Converting String to LocalDate [duplicate]
I am trying to convert a string date format to another date format(dd-MMM-yyyy) using LocalDate.
String date = "2018-04-16";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("...
0
votes
4
answers
1k
views
How can i find the oldest date in an array of Date objects in JavaScript?
I have an array of strings corresponding to Date objects. like this:
const timestamps = [
'2023-03-15T10:47:38.878Z',
'2023-03-15T10:46:51.375Z',
'2023-03-15T10:46:39.645Z',
'2023-03-...
0
votes
2
answers
371
views
Java - DateTimeFormatter not working for German Date String [duplicate]
I'm trying to parse a date String in this format: "18-Feb-23". The month is in German. I've tried this:
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d-LLL-yy", Locale....
1
vote
2
answers
176
views
Pandas date parsing from CSV file
I have one csv file:
year;month;day;hour;min;sec;temperature
2022;10;27;13;36;42;5.835
2022;10;27;14;36;42;6.435
2022;10;27;15;36;42;6.335
2022;10;27;16;36;42;6.435
And I would like to plot a simple ...
0
votes
1
answer
38
views
Date Parsing problem while Integrating to Oracle PMS
I'm recieving date in PMS message something like this |GA090616|GD090617|
which means Guest Arrival is at 09-06-16 and Guest Deprature is at 09-06-17
I wanted to parse it as date using python.
I've ...
-1
votes
2
answers
123
views
I want to compare string date (dd.MM.yyyy) to current date?
I have a String date coming in form of dd.MM.yyyy. I want to compare if its a future date (today+1 day)
I am trying to convert the string into date and getting current date from SimpleDateFormat but ...
1
vote
2
answers
26k
views
java.time.format.DateTimeParseException: Text '2023-01-25' could not be parsed at index 0 [duplicate]
I am getting error as "java.time.format.DateTimeParseException: Text '2023-01-25' could not be parsed at index 0" when passing string "2023-01-25" to parse method.
String ...
1
vote
1
answer
924
views
Golang parsing date in RFC822Z format without leading zero [duplicate]
I have a date string I can't control that I'm trying to parse into a Date.
The format most closely resembles RFC822Z.
RFC822Z = "02 Jan 06 15:04 -0700"
Reference: https://yourbasic.org/...
0
votes
1
answer
156
views
Date is displaying in different time zone when parsing a string using SimpleDateFormat [duplicate]
public class ParseDate {
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static SimpleDateFormat DateFormatter = new SimpleDateFormat(DATE_FORMAT);
public ...
0
votes
1
answer
89
views
Javascript - Storing Date as another timezone and parsing it back
The context
I've got an application that lets an admin configure a timezone for their company. Other users, then, can modify the schedule of the company, but it should be always saved with the company'...
1
vote
1
answer
1k
views
Java OffsetDateTime cannot be parsed [closed]
I want to parse the following String into an OffsetDateTime:
OffsetDateTime test = OffsetDateTime.parse("2021-12-31T23:00:00.000+00:00");
However, this results in an exception:
java.time....
0
votes
0
answers
1k
views
Converting String to LocalDate object in Java [duplicate]
I want to convert date from String to LocalDate object: Starting date as String: "12/11/2022" I want to convert this String to LocalDate. I want to get LocalDate object and next use this ...
1
vote
1
answer
174
views
DateTime javascript is showing NAN only for some users [duplicate]
I have a DateTime in c # code that I'm trying to convert it in a string before sending it to the front end.
For example, I have this C#:
DateTime utcN = DateTime.UtcNow;
string utcNow = utcN....
2
votes
2
answers
1k
views
Date format issue in Android 12
Following is the code to parse date. I have used 'joda-time:joda-time:2.9.9' lib for formatter.
String date = "Sun Sep 04 17:29:52 +0000 2022";
DateTimeFormatter dateFormat = DateTimeFormat....
1
vote
1
answer
2k
views
ParseExact - FormatException: String was not recognized as a valid DateTime [duplicate]
Here's my code
# $index is 12 (for exif 'date taken')
$value = $dir.GetDetailsof($file, $index)
$value = $value.Trim()
if ($value -and $value -ne '') {
return [DateTime]::ParseExact($value, "...
0
votes
0
answers
109
views
Convert Java String to Date in a Format [duplicate]
How can I convert a Java string to a date in this format - "31 Jan 2022". I've tried the code below.
Date sDate;
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
sDate ...
0
votes
2
answers
173
views
Date input being output as null [closed]
I get my output as null when I input date as String
this is the get and set
public Date getData(){
return data;
}
public void setData(String dataRecebida) {
try {
this.data = formatter....
0
votes
1
answer
237
views
Is there one function I can call to parse any string into the appropriate JS Temporal type?
I've got a list of ISO 8601-compatible strings, some of which are dates (like '2022-12-25'), some are date-time values (like '2022-12-25T12:00'), and some have time zone info (like '2022-12-25T12:00-...
0
votes
1
answer
69
views
Java Eclipse Scanner Date
I'm just making a program for fun.
so in my program, I want to create a start promo function, which when using it we can write the promo date, namely dd/MM/yyyy. but I'm confused, about how to get him ...
0
votes
0
answers
247
views
solve pd.read_sql: day is out of range for month
I am reading stuff from a postgresql database.
query='SELECT * FROM a_table'
conn = psycopg2.connect(*args,**kwargs)
df=pd.read_sql(query,con=conn)
I get day is out of range for month
I have tried, ...
2
votes
2
answers
1k
views
How to parse date from year and quarter using java.time
I am trying to parse strings in the format of "<year> <quarter>" ("2022 1", "2022 2") into java.time.LocalDate objects. The closest related question I could ...
0
votes
0
answers
452
views
why Java date formatter ignores seconds, milliseconds and time zone information while parsing date
I am very confused in the below code. Even after passing the correct dateformat for parsing the entire date, time and timezone, why java is ignoring the information beyond minutes.
I have a list of ...
0
votes
2
answers
1k
views
How to filter between a dates from string and datetimepicker
I am trying to filter through things by date. I have 2 DateTimePicker called FromDate and ToDate. I have an array and within one of the array (str[10]) is a date, I tried converting the string into a ...
0
votes
1
answer
3k
views
Parse String date of format yyyy-MM-dd to java.util.Date of format yyyy-MM-dd
We are using Java8 in our project.I have startDate in String format "2021-12-31" which I am receiving from from an 3RD party.
I have to pass it to our consumer via our model.Model ...
0
votes
1
answer
50
views
Errors with Inequality join in Hive
I am performing a self join in Hive and doing aggregations (percentile) on the window included in the join condition and I am getting the following errors -
Error1:
FAILED: SemanticException Line x: ...
0
votes
2
answers
493
views
How to parse text with UTC from IWebElement into date. Selenium and C#
I've got one problem. I can't parse text from IWebElement into dateTime with UTC.
Selenium without any problem takes text from page:
14.02.2022 09:46:12 UTC
And path to element is correct :
string ...
2
votes
0
answers
56
views
Know which parts a day contains
The dateparser library set missing parts of a date to today's values.
Example:
>>> import dateparser
>>> dateparser.parse("2015")
datetime.datetime(2015, 2, 14, 0, 0)
How ...
0
votes
1
answer
1k
views
moment.js parse date with strict format and locale
I have a use case where I get dates with different locales and I'am trying to parse them into RFC2822.
The issue is that with some locales moment just does not parse the date correctly.
For example &...
-2
votes
1
answer
60
views
How do I tell PHP's datetime parser that I want the "next" rather than necessarily "the current year's" date?
I get stupid datetimes such as this from the outside:
Jan-02 19:00
That means "the next 2nd January, 19 o'clock".
Currently, since the current time is in the very end of 2021, that means ...
6
votes
2
answers
38k
views
Why I can't parse this date format yyyy-MM-dd'T'HH:mm:ss.SSSZ?
I'm trying to parse a string date to a date . My string date is : 2021-12-16T11:00:00.000Z.
I have the follwing code to parse it to a date object:
val stringDate = "2021-12-16T16:42:00.000Z"
...
-1
votes
1
answer
111
views
How to parse mm.dd.yyyy with opening_hours.js?
I am using opening_hours.js in my project. Given the raw input data comes as:
03.09.2021-05.09.2021 Fr 14:00-22:00, Sa 12:00-22:00, Su 12:00-20:00
I there a way to configure the library/parser for ...
0
votes
1
answer
64
views
In JavaScript (Node.JS), how do I parse a value like '202111031437' to output date? [duplicate]
Have previously tried to use Date.parse() but 'undefined' is returned.
let datetime = '202111031437';
let parse = Date.parse(datetime);
console.log(parse);
Solved the query:
const dateParser = (...
-3
votes
1
answer
102
views
Parse a string "Unknown" to date in java [closed]
I am trying to parse a string in java that comes like this:
String test="Unknown"
But users data wants this string as date. Can it be a way to parse or avoid this case?
For example that date ...
0
votes
1
answer
1k
views
Parse "dd/mm/yyyy" into Date Kotlin
I use an GET API request and I receive a string with the format "dd/mm/yyyy". I would like to know how to parse it into Date type in Kotlin.
Here you have my code but I receive error
' java....
-1
votes
2
answers
1k
views
String to date format and vice versa
String dateFormat = "20211109";
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Date strtDt = sdf.parse(dateFormat);
String strt = sdf.format(strtDt);
I am getting an ...