Questions tagged [datetime-conversion]

Use this tag for questions related to the Datetime conversion, i.e. manipulating the Datetime in such a way, that a new, different in format, Datetime is produced.

is used in its general meaning, and is usually used for questions related on how to convert a Datetime object in another, new and with a different format, Datetime object, usually for making two different programming platforms communicate.

For example, your application may produce Datetimes of a specific format, but your Database to accept another Datetime format, different from the one your application is using. In that case, a conversion form the application's format to the Database's format is needed.

316 questions
0
votes
2 answers

Snowflake - convert string to seconds

I'm getting API response for few fields in below format, Which I wanted to convert them into seconds when loading into snowflake target table. Is there any possibilities this can be converted using any of snowflake inbuilt function? else anyway to…
Maran
  • 131
  • 4
  • 16
0
votes
1 answer

how to parse and convert 'Jan 15 2019 6:57PM' to timestamp format in snowflake

How can I convert a string in the format 'Jan 15 2019 6:57PM' to a proper timestamp format in snowflake. It is throwing error as cannot parse timestamp 'Jan 15 2019 6:57PM' to TIMESTAMP format with below command. select 'Jan 15 2019…
0
votes
4 answers

How to convert hours to seconds in carbon PHP API extension

I want to convert "2 hours 11 mins"(string) to seconds in carbon is there's any way convert that string format into seconds in carbon? I am stuck with this, couldn't find a solution yet Thank you in advance...
0
votes
0 answers

How to convert to_timestamp from oracle to mysql timestamp

This if from oracle to_timestamp('17-SEP-20 12.32.25.644000000 PM','DD-MON-RR HH.MI.SSXFF AM') Need something like this for sql STR_TO_DATE('17-SEP-20 12.32.25.644000000 PM','%d-%b-%Y %H.%i.%s.%f %p')
0
votes
2 answers

Find difference between 2 unix timestamps in php

I am trying to find the time difference between 2 timestamps. Timestamp "startTime" have 1601096400 Timestamp "expireTime" have 1601094600 I want to output the difference between both time like Expire in : 4hr 30min How do I do it in php ?
0
votes
1 answer

Conversion failed with "date" was not recognized as a valid DateTime

I try convert the date with below code, string currDate = @"Fri, 10 Jul 2020 05:48:28 -0500 (CDT)"; DateTime convDate = Convert.ToDateTime(currDate); Console.WriteLine("COnverted Date :: " + convDate.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK",…
Ramachandran
  • 103
  • 12
0
votes
3 answers

Convert to ISO string with default values

I want to convert string-presented date in custom format into ISO format. The first step is pretty easy: val parsed = DateTimeFormatter.ofPattern(pattern).parse(input) Now I want to present this parsed value in ISO string, the problem is that input…
0
votes
2 answers

Converting Instant to LocalDate and back

I have a problem with converting dates between Instant and LocalDate and back. I need to change my date to monday in its current week (if it's wednesday then I'm changing to monday): public static Instant getStartDateAsMonday(Instant startTime) { …
Garion S.
  • 119
  • 2
  • 9
0
votes
1 answer

Convert timezone from CEST TIME to UTC in Android

I m building an application in Android studio using Api level 21. I must convert a Date from CEST TIME | GMT | CET in UTC time. This is the format time. SimpleDateFormat utcFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); String…
bircastri
  • 2,169
  • 13
  • 50
  • 119
0
votes
1 answer

ROR + Ruby Date Decrease by 15 minutes

If I have @time = Time.now.strftime("%Y-%m-%d %H:%M:%S"), How can I reduce this time by 15 minutes ? I already tried this one :: @reducetime = @time-15.minutes, works fine at console but give errors while execution. Other than this Is there any way…
Rubyist
  • 6,486
  • 10
  • 51
  • 86
0
votes
3 answers

Put a dataframe in chronological 'dd.mm.yyyy' order using pandas

I have a csv-file with several columns, one contains the date in the format dd.mm.yyyy. Its entries (rows) aren't in chronological order. What I did to put them into order is transforming those values using pd.to_datetime, followed by sort_values.…
0
votes
2 answers

Converting Time Zones from a String to UTC (JODA TIME)

I have a stored UTC timestamp in the database. When I retrieve that UTC timestamp I cast it into a String. I want to take that UTC Timestamp String and convert it to the device's local time using Joda Time. Anyone who could possibly help out with…
0
votes
2 answers

Converting string (with timezone) to datetime in python

I aim to convert stringtime = '2020-02-30 10:27:00+01:00' so that I can compare it to nowtime = datetime.datetime.utcnow() using if nowtime > stringtime: print(1) I tried strptime: datetime.datetime.strptime(stringtime, '%Y-%m-%d…
cheesus
  • 1,111
  • 1
  • 16
  • 44
0
votes
0 answers

Convert Timestamp to local time in MySQL

I have a table in MySQL Below is the structure of the table.. in that I have 2 column Date and Time and the timestamp is based on the country column.. I would like to convert this time into IST.. can any one help me how can we do this without a…
ansh
  • 573
  • 3
  • 9
  • 26
0
votes
1 answer

Java String DateTime to toEpochMilli - Different Regions

I am developing a string conversion method for toEpochMilli(). But I am getting different results when I publish the code on a different time zone region server. How to solve ? //input = "2019-12-26T00:00:00" private static Long…
phdias
  • 205
  • 1
  • 11