Questions tagged [string-to-datetime]
217 questions
3
votes
1 answer
error on converting string to date in java
2014-04-23T18:30:00.000Z need to convert in this format yyyy-MM-dd'T'hh:mm:sszzz in java
I am using this
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.zzzZ");
Date newfromDate = new Date();
try {
//Convert into date…

Er KK Chopra
- 1,834
- 8
- 31
- 55
3
votes
2 answers
String to dateTime in C#?
How Can I convert following date string to dateTime:
Fri, 18 Dec 2009 9:38 am PST
I tried DateTime.Parse(string)
I got following error:
The string was not recognized as a valid DateTime. There is an unknown word starting at index 25.…

AliRıza Adıyahşi
- 15,658
- 24
- 115
- 197
2
votes
2 answers
I want to convert string to date in java
I have a string like "hh:mm:ss.SSSSSS" and I want to convert this string to Date and I want to get "hh:mm:ss.SS". However, when I compile my code, it still gives the day month year time and timezone like "Thu Jan 01 10:50:55 TRT 1970". I attached my…
user14360671
2
votes
1 answer
Convert strings to date and time in Anylogic
my agent has the next information as parameters:
year, month, day, hour, minute second. Now I want to transform all these parameters to a date by using
toDate(year, month, hour, minute, second)
But somehow I still get the error that I can only…

Aron T.
- 448
- 2
- 7
2
votes
2 answers
What's the difference between changing datetime string to datetime by pd.to_datetime & datetime.strptime()
I have a df that looks similar to this (shortened version, with less rows):
Time (EDT) Open High Low Close
0 02.01.2006 19:00:00 0.85224 0.85498 0.85224 0.85498
1 02.01.2006 20:00:00 0.85498 0.85577 0.85423 0.85481
2 …

saga
- 736
- 2
- 8
- 20
2
votes
1 answer
how to transform string date format using iso 8601 and week numbers
I have this:
import pandas as pd
data = pd.DataFrame({'Date': ['2019-01-30', '2019-12-31', '2018-12-31']})
data['Date'] = pd.to_datetime(data.Date)
data['Period'] = data.Date.dt.strftime('Y%G-W%V')
data['Period'] = data['Period'] +…

Náthali
- 937
- 2
- 10
- 22
2
votes
1 answer
Changing String into Time
I need to change String in D column(example 28/10/2018:01:51:29) into Time format.
I've tried:
Format cells and make my own formating(dd/mm/yyyy:hh:mm:ss)
Data->Text to columns
But neither worked
2
votes
1 answer
mongoDB multiple-levels nested string conversion to date objects
I have a mongoDB containing entries like this:
{ "_id" : ObjectId("5bdb6a44d9b2d4645509db2e"),
"crs" : { "type" : "name",
"properties" : { "name" : "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"type" : "FeatureCollection",
"features" : [ {…

andrea pagani
- 43
- 7
2
votes
1 answer
I want to parse string as date using DateTimeFormatter with in "MMdd" but it is even parsing string like "3212" which is wrong
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("MMdd");
dateTimeFormatter.parse("3212");

Java Techie
- 33
- 2
2
votes
1 answer
Python - Date parser that could get all the dates from a specific string input
Currently doing a task that has given to me which is partly related to machine learning. The task is to parse a string input from the user into a date, given that I could have 2 parameter for the function: date_from and date_to; something like the…

JJ186021
- 31
- 1
- 10
2
votes
2 answers
Create datetime column from month and day with year based on month
I have columnar data of dates of the form mm-dd as shown. I need to add the correct year (dates October to December are 2017 and dates after 1-1 are 2018) and make a datetime object. The code below works, but it's ugly. Is there a more Pythonic…

Matt Wood
- 111
- 1
- 1
- 7
2
votes
1 answer
Pandas to_datetime not working for null values
Right, I'm going to be as clear as I can.
Here's my dataframe called base_varlist2.
completion_date_latest completion_date_original customer_birth_date_1 \
0 07/10/2004 17/05/1996 04/02/1963
1 …

Aaraeus
- 1,105
- 3
- 14
- 26
2
votes
1 answer
How to convert an input string into strtotime in laravel
I am using jQuery calendar to input dates in the form like

Hassaan
- 339
- 1
- 8
- 20
2
votes
1 answer
How to format year and month only, from a bulk insert
I have data from excel that has only the year and month e.g 2012-01
With 01 being January.
For my Script:
IF OBJECT_ID('[test].[dbo].[yearMONTH]', 'U') IS NOT NULL
begin
DROP TABLE [test].[dbo].yearMONTH;
print 'Dropped Table…

VS1SQL
- 135
- 2
- 13
2
votes
1 answer
Pandas, Handling "Out of bounds timestamp..."
I have a df with certain features as object types which I want to convert to datetypes. When I attempt to convert using pd.to_datetime, some of these features return an "Out of bounds timestamp" error message. To address this, I add "errors=…

GPB
- 2,395
- 8
- 26
- 36