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

Convert UTC Time To Local DST Time

I want to convert UTC time to local Time Zone where Time Zone will be dyanamic. The question is asked because I want my UTC date to get converted automatically using DayLightSaving Time. DayLightSaving for Adelaide on 2019-04-25 is +4 hours and…
Akki
  • 61
  • 1
  • 2
  • 10
-1
votes
1 answer

Null class to Date-time Class for qplot in R

I have a csv file with 2 coloumns-price and date.I am trying to do time series forecasting and for that I need to convert the date coloumn to date-time class. Presently the class of Date coloumn is NULL.I tried to convert it to character format,but…
Bunty
  • 51
  • 2
  • 3
  • 8
-1
votes
2 answers

How do I convert local time zone to utc and utc local time zone?

I want to store UTC time in DB (yyyy-mm-dd or dd-mm-yyyy) I want to convert local time zone to UTC and store it in DB I tried in different ways but that is not working properly. Below is my code for convert local to UTC get the UTC time from DB…
shiv
  • 21
  • 1
  • 8
-1
votes
4 answers

Time Conversion 12H to 24H

I wrote this code to convert 12H time to 24H time but with an input: 07:05:45pm I get output as: 07:05:45 Here's the code import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class…
Karan
  • 11
  • 1
  • 5
-1
votes
3 answers

Date conversion in UTC/ISO 8601 format

I am working on date conversion. I am converting this 2017-08-17 13:00:00 format of date to 2017-08-17T13:00:00Z working example: var from_date; var sdate = new Date( '2017-08-17 13:00:00' ); var utcSDate = sdate.toISOString(); from_date =…
Noob Player
  • 279
  • 6
  • 25
-1
votes
1 answer

API for timezone conversion

Is there any API available for datetime conversion between different timezones similar to google map's timezone api's. Explaination for datetime conversion between different timezones - Given the base timezone, datetime in base timezone and target…
Sumit Paliwal
  • 385
  • 1
  • 3
  • 14
-1
votes
2 answers

How to get milliseconds?

I'm doing a countdown timer, I got rid of int variable and made long. The following methods how I get hours, minutes and seconds. public static long getHours(long totalSeconds) { return (long) Math.floor(totalSeconds / 3600000); } public static…
P. Dm
  • 125
  • 12
-1
votes
2 answers

VB script with sql insert. Conversion of a varchar data type to DateTime

The current info needs to be handled: Tid: 13.12.2014 01:48:48 what the script contains handling this is: if isArray (arrString) then if uBound (arrString) > 0 then Select Case lcase (arrString(0)) Case "tid": tid = trim…
vya
  • 57
  • 1
  • 2
  • 7
-1
votes
2 answers

How to change time(7) format from 24 to 12?

I have a variable as time(7), but it gives me values like: '17:25'. I'd like for it to be in this format: '5:25 PM'. Is there a way to do this in SQL 2012 without doing something like this: DECLARE @aux NVARCHAR(8)='16:45:00' SELECT…
dotnetN00b
  • 5,021
  • 13
  • 62
  • 95
-1
votes
2 answers

Why is the proper conversion of nanoseconds to seconds changing in Java when I write to the console?

I'm currently cleaning my game loops timing in java, but I'm having a very strange issue with nanoseconds to seconds conversion. For some reason when I don't write to the console getting the nanoseconds passed into a time delta (measured in seconds)…
-2
votes
1 answer

from string to datatime in python

I have a dataset including all days in 2020 where solar and wind generation is measured on a 15 basis: 01.01.2020 00:00 - 01.01.2020 00:15 How do I convert this to datatime? I already tried this: dftotalload2020['Time (CET/CEST)'] =…
J1999
  • 3
  • 2
-2
votes
1 answer

convert timestamp integer into something index/seconds

I am having a bit of a brainfart and having trouble changing ISO timestamp into seconds in c++. The current timestamp is ISO standard in single string for example 202207032201, 2022 July 3 22:01h and for the time being I took this as an integer and…
Sj L
  • 41
  • 5
-2
votes
2 answers

What is the algorithm represented in Java to convert an 12 hour am/pm meridiem format hour to 24 hour format?

I needed to convert only the hour part of 12 hour time string to 24 hour format. I'm not interested in other than hour parts of a date string. SimpleDateFormatter is notoriously buggy and I in fact I'm more interested in the conversion algorithm…
Tonecops
  • 127
  • 9
-2
votes
1 answer

Convert Decimal Time to human readable format using JavaScript

I have a web service that returns the current time in Decimal format. How I can convert it to a human-readable format using JavaScript. Here is what documentation says. The web service returns dates and times as floating-point values. The fraction…
Abdul Waheed
  • 383
  • 1
  • 4
  • 20
-2
votes
3 answers

Date Changes After Formatting It to "YYYY-MM-DD" In C#

My date changes values when I format it to "yyyy-mm-dd". It becomes "2019-54-10" instead of keeping the correct DateTime.Now. Bellow is my code: public static DateTime CurrentDate = DateTime.Now; ConvertedCurrentDate =…
William
  • 201
  • 3
  • 7