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
1 answer

Month format in humanfriendly

I'm making a Discord bot and for my tempmute command I'll use the new timeout feature. Since the time of the tempmute is variable, I use the library humanfrinedly to convert it. The usage of the library is: s for seconds m for minutes h for…
Tommodev
  • 95
  • 6
0
votes
4 answers

Php time format conversion

I have the following timeformat:15/08/2011 12:32:23 day/month/year hour:minute:sec and I want to convert to the following format: Y-m-d H:i:s I tried with date('Y-m-d H:i:s', strtotime($time)) but it not works. It swaps the month and the day when…
Mokus
  • 10,174
  • 18
  • 80
  • 122
0
votes
1 answer

Comparing stored time string to DateTime('now')

I'm storing time as a string in my database... hopefully that's not my problem, I need to compare that stored time/date to the current time/date and get days/hours/minutes. It's stored in this format... 11-10 07:42 PM I assign that string to…
0
votes
2 answers

Creating n minute intervals per table row

I'm trying to get time intervals based on a table. My source table is something like this: ID OTHER_DATA TIME_BEG TIME_END DURATION 1 abcd 10:00 11:00 15 2 xyzt 16:00 17:00 30 Desired…
Intranet
  • 15
  • 4
0
votes
1 answer

I want to convert given time into miliseconds. The given time is not direct date object

The given time format is '1 Day 10 Hours 10 Minutes 13 Seconds'. Here - it includes notation which we use to denote time units like - Hr or H or Hours or Hrs. Same for other time units also. Is there builtin method or known this is there?
Akhil A
  • 59
  • 3
0
votes
1 answer

How to convert string in format ("dd-M-yyyy kk:mm:ss z") to LocalDateTime of server in java?

I need to convert dates in this format = "dd-M-yyyy kk:mm:ss z" to LocalDateTime as per server time. So far, I've tried every approach I could find here and on other blogs, but none helped. That's why I asked a new question. DateTimeFormatter…
0
votes
2 answers

convert timestamp to current time format in SQL

I have a timestamp column with value coming in this format: 2021-07-20T18:40:36.368126186Z I want to convert the the result to make the timestamp clean as (in 24 hours format): 2021-07-20 18:40:36 I tried using the DATE field and it only gives me…
trojan horse
  • 347
  • 2
  • 10
0
votes
1 answer

Converting local datetime values to UTC datetime values in SQL Server and PostgreSQL

I am trying to understand the behavior of AT TIME ZONE and I get some strange behavioral differences between SQL Server and PostgreSQL in this regard. For demonstration purposes I produced two queries, one for SQL Server and one for PostgreSQL. The…
Bart Hofland
  • 3,700
  • 1
  • 13
  • 22
0
votes
1 answer

Converting a decimal GPS time to UTC

There's many similar questions out there but I haven't found one specific to the GPS output data I am receiving. The data from my GPS is in decimal form: GPS Week: 2145 and GPS Time: 330374.741371 (the manual says this is a double that represents…
Two Bits
  • 11
  • 1
0
votes
1 answer

Android Date.from() taking device timezone into account?

Using the following code in Java8 - newTable.LogDate = Date.from(ZonedDateTime.of(year, month, day, 0, 0, 0, 0, ZoneId.of("GMT")).toInstant()); The LogDate is ending up adjusted for my (and my user's) devices. In the above case, for example, if I…
Coyttl
  • 537
  • 1
  • 4
  • 19
0
votes
1 answer

Converting a varchar timestamp (with possible single digit date or month) to datetime

I have to convert timestamp which is in varchar (3/12/2021 1:38:53 PM) to datetime using SSIS. This is code I used to do the same (DT_DBDATE)(SUBSTRING(TimeStamp,FINDSTRING(TimeStamp,"/",2),4) + "-" +…
0
votes
1 answer

TimeZoneInfo.ConvertTimeFromUtc is returning the wrong value

I'm taking a set date/time value and converting from UTC, but timezone. I'm expecting to get the original time - 5 to be the correct time in the EST time zone, but it is off by 1 hour and only offset it by 4 hours. string dateString = "3/15/2021…
kalapakim
  • 3
  • 2
0
votes
1 answer

How can I convert float number into minutes to be added to the current UTC time with Javascript?

I apologise in advance for being a complete dunce but these are in fact my very first shaky steps into trying to get something done with Javascript and I feel somewhat lost and confused. I have the following float: 53.93 This decimal value…
0
votes
1 answer

Issues with Moment and ChartJS Time Format Parsing

I am attempting to mimic a gannt chart format using ChartJS 2.9's floating bar feature. So far I have managed to do something similar with a line chart and some creative bending of ChartJS but there were serious flaws with it and it was not…
Geowil
  • 624
  • 1
  • 12
  • 36
0
votes
2 answers

Convert a chr time in to actuall time in R

so I'm trying to convert a F1 Laptime that is written in a chr in to time which I can then plot into a histogram. This is what i tried. But with no success. lapTimes <- lapTimes %>% mutate(Time = ms(Time)) format(as.POSIXct(lapTimes$time, tz = ""),…