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

Converting Navy sunset/sunrise data into time

I have downloaded the 2015-2017 sunset/sunrise data from the Navy and I am trying to format it into dates and time to further use with other data I have. This is how my data set looks in R. I have managed to convert the date into the right R data…
0
votes
1 answer

How do I convert this javascript date picker date to milliseconds?

I need to do a conditional where I test whether the date from a date picker has passed already. I need to compare it to todays date using Date.now(); which returns milliseconds. when I my log date picker date from my object -…
Spilot
  • 1,495
  • 8
  • 29
  • 55
0
votes
2 answers

Insert DatetimePicker's value into a funtion

private void btntest_Click(object sender, EventArgs e) { DateTime d = new DateTime(2016,2,13); LunarDate ld1 = LunarYearTools.SolarToLunar(d); lblamlich.Text = (ld1.ToString()); } Note DateTime d = new DateTime(Int…
Jr.Kan
  • 15
  • 5
0
votes
0 answers

converting military time to standard time in ionic 2

This block of JS is a date formatting solution I found online and it works well, however it doesn't include a way to convert the time from military time to standard time and account for PM/AM differences. How can I add to this? HTML
Spilot
  • 1,495
  • 8
  • 29
  • 55
0
votes
5 answers

Parsing between int and string giving unexpected results

Below line of code gives NullPointerException in java for any input (07,11 etc in src) hrs = Integer.toString((Integer.getInteger(hrs)) + 12); So i changed it to : Integer H = Integer.parseInt(hrs); H = H + 12; hrs = H.toString(); Which is…
0
votes
2 answers

Adding a column to a table in MySQL database with default value

I have a table named tab1. I want add a new column to the table. I tried alter table tab1 add column mod_at TIMESTAMP default CURRENT_TIMESTAMP I succeeded in adding the column. But the default timestamp value added will be local timestamp. How to…
Virat
  • 551
  • 4
  • 9
  • 23
0
votes
2 answers

Date time convertion with daylight saving

I am using following code to convert date time between time zones TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(site.TimeZone); returnTime = TimeZoneInfo.ConvertTime(DateTimeOffset.Parse(time.ToString()), timeZone); The daylight…
udaya726
  • 1,010
  • 6
  • 21
  • 41
0
votes
0 answers

Oracle SQL query output from GMT to PST

I am using below query for order trend on hourly basis in my application: select TO_CHAR(A.CREATED_DATE,'dd/mm/yyyy hh24') || ':' || DECODE(TRUNC(to_number(to_char(A.CREATED_DATE,'HH'))),0,'00','00') "date", count(*) cnt FROM Schema.Table1 A,…
Iqbal
  • 3
  • 3
0
votes
1 answer

Removing Zero from Beginning of 24 Hour Time conversion

This is for a problem on Time Conversion from the 12-hour format to the military/24-hour time. The standard input: 07:05:45PM The expected output: 19:05:45 The standard/actual output: 019:05:45 The problem lies in the zero ^ at the beginning of the…
Jon Langel
  • 157
  • 1
  • 2
  • 11
0
votes
3 answers

Conversion String to Datetime (24 hour format) is not match

I have a string 10/13/2016 21:42 Dim ETAtime1 As String = Convert.ToDateTime("10/13/2016 21:42").ToString("MM/dd/yyyy HH:mm") 'result is 10/13/2016 21:42 I want the result to be 10/13/2016 21:42 (24 hour format) like the above string. But why,…
Bcktr
  • 208
  • 1
  • 8
  • 22
0
votes
2 answers

PowerShell - Converting UTC To British Summer Time

I have written a simple function to convert any UTC time to current UK time (depending if Daylight Saving Time is being applied at the current season the result is either the same UTC or UTC + 1): function Convert-UTCToUKTime { …
Arnoldas Bendoraitis
  • 1,055
  • 1
  • 11
  • 17
0
votes
2 answers

Converting UNIX to HH-MM-SS Javascript

I am trying to conver unix timestamp to a readable time. I have tried all solutions I can find, none still work. I do not want to use any modules or frameworks. Id appreciate some help converting.(Angular) Please dont link to other questions. ive…
0
votes
2 answers

Generic function which accept all varchar type and return specific datetime format in Sql server

Input: 11-07-2016 14:21:59 08/07/2016 5:12:52 PM Output: 2016-07-11 14:21:59 2016-07-08 17:12:52 My date in the format of dd-mm-yyyy hh:mm:ss The input need to return in specific format as yyyy-mm-dd hh:mm:ss Please suggest.
MDev
  • 41
  • 5
0
votes
1 answer

Convert 64-bit Hex to nanoseconds timestamps

I have timestamps that are represented in 64-bit hex. Is there a way to convert it to nanosecond timestamps? (preferably in c++)
0
votes
1 answer

How to get End time based on selected Start time and Interval?

Currently working on a project where I have to build time picker with start, end time and interval of meeting. User first pick start time for example 7:15am, then next step is to pick meeting interval that range from 5 min up to 60 min, and last…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193