Questions tagged [string-to-datetime]
217 questions
1
vote
2 answers
Convert month shortname to month number
I am searching for a built-in function in MySQL for getting Month Number for given Month Short Name like 'Jan','jul',etc.

Romesh
- 2,291
- 3
- 24
- 47
1
vote
1 answer
SQL Server: convert to today then add 8 hours
nextUpdate can be any date time value in the past. I'm trying to update the nextUpdate field to today's date but keeping the time unchanged and then add 8 hours.
I get
error converting string to datetime
T-SQLe:
UPDATE
…

Hami
- 335
- 1
- 7
- 22
1
vote
1 answer
Mysql Varchar to GMT Date time value conversion
I appologize for asking this question, but i have searched and kind find anything specific to my needs. I have worked with it but can not seem to make ends meet.
I have a column SrcFileName (VarChar(100))
It is populated with filenames (i.e.…

phenicie
- 637
- 8
- 14
1
vote
3 answers
custom format directive for python strptime
I have to receive a string representing a date to process through time.strptime in a format similar to %d%m%Y but the thing is that when the day number is less than 10, then the day will be presented as a one digit number, not a two digits one as…

Javier Novoa C.
- 11,257
- 13
- 57
- 75
0
votes
2 answers
Unable to parse string to DateTime
I have this string:
Fri, 13 Jan 2012 04:26:42 PST
I tries to parse it like that:
DateTime.TryParse("Fri, 13 Jan 2012 04:26:42 PST", out date)
Or like that:
Convert.ToDateTime("Fri, 13 Jan 2012 04:26:42 PST")
And it throws to me:
MESSAGE: The…

Nir
- 2,497
- 9
- 42
- 71
0
votes
1 answer
Heroku: to_datetime does not take into account the rails' i18n.locale
Edit: (to be clear and to the point)
I want the following to work on heroku: "11/13/2011".to_datetime, meaning I need the dates to be in english format. Thanks
I've set this the i18n locale in my application.rb
config.i18n.default_locale =…

Robin
- 21,667
- 10
- 62
- 85
0
votes
1 answer
timestamp object cannot be converted to MYSQL type
I have a dataframe with string dates
I convert them to datetime time using pd.to_datetime()
then when I create insedrt query and make cursor.execute() it returns this error to me
"mysql.connector.errors.ProgrammingError: Failed processing…

Carol
- 21
- 2
0
votes
2 answers
How to convert YYYYMMDD string to date in databricks SQL end point?
How to convert YYYYMMDD string to date in databricks SQL end point?
Input values:- 1. 20230804
2. 20230805
output values :- 1. 2023-08-04
2. 2023-08-05

Rajashekhar
- 75
- 11
0
votes
1 answer
ValueError: time data 'X' does not match format '%m/%d/%y %H:%M' (match)
and I encountered a problem when I was using pandas.to_datetime to convert a column to datetime, could you help me to figure out why? Thank you.
I tried to change the format but I don't know what is wrong.
0
votes
1 answer
Conversion of Strings like 'June 13, 7:23pm EDT' to Dates in BigQuery
My timestamp data looks like
June 13, 7:23pm EDT
The data is in string format. I need to convert it to
2023-6-13
Is there a way to do that? I am using BigQuery.
If I do:
select cast('June 13, 7:23pm EDT' as date);
I get this error:
Invalid date:…

Rashida
- 401
- 7
- 18
0
votes
1 answer
Date conversion error in DataFrame in pandas, can anyone point why this issue is happening and how to fix it
i am trying to convert my two date columns in my dataframe. however some of the date is converted using "%d/%m/%Y" and a few of the data is getting converted using "%m/%d/%Y" . the issue is happening only from 01-May-2023 to 12-May-2023. from 13 may…

Amirul Islam
- 11
- 4
0
votes
1 answer
Converting a String Date to Date Format Error: 'String is not a Valid DateTime'
I want to convert string format date value to date format ("dd/MM/yyyy").
String EntryDate = "24052023";
DateTime ResultDate = Convert.ToDateTime(EntryDate);
DateTime ResultDate =…

arbabu
- 17
- 4
0
votes
0 answers
pd.to_datetime() does not work in windows terminal
I have been running python scripts in windows power shell for quite some time.
All of a sudden this morning I get this error message:
line 3802, in get_loc
return self._engine.get_loc(casted_key)
File "pandas\_libs\index.pyx", line 138, in…

D.L
- 4,339
- 5
- 22
- 45
0
votes
1 answer
How to compare a date field which is stored in string format in mongo db version 3.2?
I have a mongo db field in where customer has stored the date in string format like below. VTimestamp: "3/12/2023, 10:07:12 PM". ( MM/DD/YYYY HH:MM:SS ) So now we have a requirement where we will get two dates & we need to compare those dates with…

sasi
- 836
- 4
- 17
- 33
0
votes
2 answers
drop year and month and year from a date format
so I want to convert this column from str to date format ,i used the following
df["Time"]=pd.to_datetime(df["Time"],format='%H:%M')
OUTPUT:
0 1900-01-01 02:29:00
1 1900-01-01 06:52:00
2 1900-01-01 10:23:00
3 1900-01-01…

drdarkfrancis
- 43
- 4