Questions tagged [string-to-datetime]
217 questions
0
votes
2 answers
Parse String to Date in java
I have date like mm-dd-yyy in string format and I am trying to convert the same to Date object in java,
Two ways I tried in
sending the date format as "mm-dd-yyy" which is returning the wrong
date, it always returns month Jan even though the month…

786543214
- 855
- 4
- 14
- 29
0
votes
1 answer
how to convert string to time with format HH:MM AM/PM in JAVASCRIPT
this will be my first time to use javascript as a part of my project. And i need to convert a string in format HH:mm AM/PM to a 24 hr format (00:00:00) time. Please help guys! Thank you in advance.

Aljie
- 190
- 1
- 4
- 15
0
votes
0 answers
MySQL-> many date format as varchar to date format
I need to change a column that contains many date formats (now is varchar) like
09-10-09
19/01/2009
19/01/09, etc
into a column with date format (year,month,day). I try this query but brings me error.
SELECT CASE
WHEN data_rep LIKE "%/%/%"
…

AlexBasa
- 17
- 4
0
votes
1 answer
Using STR_TO_DATE in Java to INSERT Date, with PreparedStatement
Let's suppose we have a JFrame called FrmRegistration. Its function is inserting data into a table called records.
MySQL's command desc records would result the following:
+-----------+--------------+------+-----+---------+-------+
| Field |…

Rasshu
- 1,764
- 6
- 22
- 53
0
votes
1 answer
Python string to date conversion
I am using Python 2.7.3 and trying to parse a CSV file using csv reader as:
date_format = '%m/%d/%Y %H:%M%'
with open(data_base+data_file_short, 'rb') as f:
reader = csv.reader(f)
for row in reader:
#use row here to convert string…

Moon
- 64
- 1
- 7
0
votes
3 answers
Converting String Format Date for Date Object
I am getting a Date format in String as Output like this.
Fri May 18 00:00:00 EDT 2012
I need to Convert this to a Date Object. What approach shall I use?
Thank you.
This is the program i used.
import java.util.*;
import java.text.*;
public…

Azar
- 32
- 1
- 7
0
votes
1 answer
NSDateFormatter not converting string to date
I'm using NSDateFormatter to convert a string to a date. However, the date returned is nil.
It is only my hard-coded string that causes the problem. When I use stringFromDate: and convert this NSString to an NSDate it's fine.
Hard-coded date:
…

SEG
- 1,717
- 1
- 18
- 33
-1
votes
1 answer
time data 2018-01-01 00:00:00+00:00:00 doesn't match format specified
I am trying to create a DateTime series with the following date format:
'2018-01-01 00:00:00+00:00:00'
time_steps = pd.to_datetime(f['forecast_time'][...].astype(str), format='%Y-%m-%d %H:%M:%S', errors='raise', utc = True)
And I am getting the…

Heaton135
- 1
- 1
-1
votes
1 answer
Derive dob / date of birth from merged numbers in pyspark or python?
I am trying to derive DOB in the date datatype format (YYYY-MM-DD) in pyspark from a column that has the info reversed, as a large integer, and with single digit day/month's leading zeroes removed. This last point means the data varies between 6-8…

Olivander
- 57
- 7
-1
votes
1 answer
Create an Instance of ZonedDateTime from String with same time as String [Java]
I want to create an instance of ZonedDateTime from String. I want to make "2021-03-18 8:00:00" turn into "2021-03-18 8:00:00 EST". I don't want an unexpected variable to interfere by converting 8:00:00 to a different time from what is shown. i.e…

Coal Miner 555
- 3
- 1
-1
votes
3 answers
Cannot convert string to date for datePicker
I try to get string from textfield, then convert it to date and put this value in datepicker. But for some reason it fails everytime and I get: "There is issue in dateformatter. Not able to convert string to Date".
I don't understand what I'm doing…

ucelme
- 97
- 1
- 13
-1
votes
1 answer
Convert SQL date varchar(512) to dd/MM/yyyy
When I want to "translate" a Ndate figure into dd/MM/yyyy I use this
convert(varchar(16),dateadd(day, d.Field_Date, '01-01-1970'),103)
But I have a field that's VARCHAR(512) with that very format, and I'd like to convert that string to a date…

Juan M.
- 59
- 1
- 5
-1
votes
2 answers
How to convert a string into a date in swift
I parsed the code "1442351280" from JSON and and I want to convert it to date in swift in medium style.
-1
votes
3 answers
Days on earth Calculator in C#
I've been trying to create a Days on Earth Calculator in C#, where the user can input their birthdate in MM/DD/YYYY format and find out how long they've been on this earth(in days). I already checked out a similar question that someone posted 2…

Ninjatix
- 75
- 1
- 1
- 7
-1
votes
1 answer
How to remove time from the out of to_datetime?
Using the to_datetime function I am getting the dates as well as the time when i am print it out. I only need the dates. Is there any method to remove it while converting?
pd.to_datetime(pd.Series(dates))
0 2013-12-20 00:00:00
1 …

jithinvr
- 11
- 3