Questions tagged [string-to-datetime]

217 questions
0
votes
1 answer

php string to date conversion from multiple date format

I want to convert the string date to following format 'Y-m-d' from multiple date format like for example 12-3-17, 12-3-2017, 12.3.17, 12.3.2017, 12.03.17, 12/3/17 $ymd = DateTime::createFromFormat('m-d-Y', '10-16-2003')->format('Y-m-d'); The…
Dan
  • 69
  • 1
  • 8
0
votes
3 answers

DateTime.ParseExact throwing exception

I'm pretty sure that I am making some very stupid error but this is driving me insane. I am trying to do the following: var dateTime = DateTime.ParseExact("08/24/2016 12:00:00 AM", "MM/dd/yyyy HH:mm:ss tt", CultureInfo.InvariantCulture); But I keep…
Talon
  • 3,466
  • 3
  • 32
  • 47
0
votes
1 answer

pandas dataframe converting complex date-format to date dd/mm/yyyy hh:mm

I'm using python and pandas to transform csv's, I imported the csv as a dataframe. the dataframe has a string-column containing dates in format "January 1, 2016, Hour 0" I'd like to convert that string into a date or even string in format…
0
votes
1 answer

Convert from fr-CA time to US time format

I have a string datetime like this in fr-CA time : "16 août 1980". How can i change this string to US time like "16 aug 1980" or "august 16 1980" using c#? I need create a cultureinfo of this time?
lamtacvu
  • 675
  • 1
  • 7
  • 14
0
votes
4 answers

Generate a datetime format string from timestamp

I want to generate time/date format strings from the input data I got. Is there an easy way to do this? My input data looks like this: '01.12.2016 23:30:59,123' So my code should generate the following format string: '%d.%m.%Y…
Burner
  • 71
  • 1
  • 12
0
votes
3 answers

Rails Time Zone: How to pass time zone configured in application.rb file as parameter to the to_datetime method?

I configured my time zone to indian time zone in my Rails app by adding this line config.time_zone = 'Mumbai' to my application.rb file. I am having a date time field t.datetime :check_in in my table. To this check_in column I am saving the server…
John
  • 1,273
  • 3
  • 27
  • 61
0
votes
2 answers

parse string into date format

I am importing data from a csv file via opencsv to insert into a mysql DB. opencsv imports as string and for 1 field in the DB I need to parse it to date in the format: yyyy-MM-dd. However I am getting an error. // This is the string that I have…
user1523236
  • 1,403
  • 3
  • 20
  • 43
0
votes
1 answer

IllegalArgumentException when using joda-time to convert string to date

I have a code as below to convert a string to date: DateTimeFormatter formatter = org.joda.time.format.DateTimeFormat.forPattern("MM/dd/yyyy"); LocalDate checkInDate = LocalDate.parse("08/25/2015"); But when i run the code there is an…
Luasg
  • 93
  • 1
  • 11
0
votes
2 answers

Convert date to string in php to zulu UTC format, not a duplicate topic?

Hi I have posted this question before, but people marked it as a duplicate questions. so I didn't get any answer. I am trying to get the current date/time in the format for example "20150701183741.941Z', I am not sure what the technical term for…
special_cheese
  • 160
  • 1
  • 3
  • 14
0
votes
1 answer

How convert date in SQL with respect to system culture?

Currently am using below mentioned code CONVERT(DATETIME, "16-05-2015 21:27:25.280",105) Using this its working in my system culture and one of our client in UK. But facing issue in our US client. Error message: The conversion of a nvarchar data…
thejustv
  • 2,009
  • 26
  • 42
0
votes
1 answer

Unable to convert this Character type to a proper Date type in R

I have a data set that has a column for dates (emp2$hiredate) which is in char format. While converting it to Date, I'm getting the following error : > date1 <- emp2$hiredate[2] > str(date1) chr "20FEB1981" > as.POSIXct(date1) Error in…
sunitprasad1
  • 768
  • 2
  • 12
  • 28
0
votes
1 answer

Bash scripting: date -d won't accept my string format of hhmmss. I need a workaround

I need a Bash script to accept 1 argument representing a time in hhmmss format, and from that derive a second time 3 minutes before that. I've been trying to use date -d: #! /bin/bash DATE=`date +%Y%m%d` TIME=$1 NEWTIME=`date -d "$DATE $TIME - 3…
ibonyun
  • 425
  • 3
  • 11
0
votes
0 answers

Why is very time consuming to transform a pandas-series with pandas-datetime values into a list?

I had a pandas data frame in which one column contained dates given as strings (for exampel "2014-10-17". I wanted to have this values as Python date objects. I decided to make this transformation in two steps: df.col =…
Roman
  • 124,451
  • 167
  • 349
  • 456
0
votes
2 answers

Convert yymmdd to datetime using ssis derived column

Below are the strings representing date of birth (yymmdd). I want to convert it into datetime format and load into a database using ssis. How can I do it? In my derived column I have (DT_DATE)(SUBSTRING([Drv DOB],1,2) + "-" + SUBSTRING([Drv…
apariyar
  • 35
  • 2
  • 11
0
votes
1 answer

Converting two strings to date time format and creating count down timer with these dates in android

In this question I have two doubts. Firstly I have two string variables named biddate and placeddate respectively which contains date and time in string format.The value in biddate is in this format: 17-Feb-14 12:54:00 PM and the value in placeddate…
njnjnj
  • 978
  • 4
  • 23
  • 58