Questions tagged [unix-timestamp]
The number of seconds between a particular date and the Unix Epoch on January 1st, 1970
2,330
questions
1
vote
1
answer
34
views
Understanding Unix Timestamps and Time Zone Conversion in Python
I'm having trouble understanding Unix timestamps and time zone conversions in Python. I have a UTC datetime string ('2023-09-20T05:04:54') and latitude/longitude coordinates (around Toronto). I need ...
-1
votes
0
answers
17
views
Casting a variable from unix as time stamp in hive sql [closed]
I have an environment file which has a variable that stores the time stamp taken from unix server. I am trying to call this variable into my query which is in a JSON file by casting it as timestamp. ...
0
votes
1
answer
18
views
convert string type datetime values to specific format in pyspark
I have a pyspark dataframe having below types of date time values (string type) -
|text|date_filing|
|AAA|1998-12-22|
|BBBB|2023-08-30 12:03:17.814757+00|
|CCC|null|
|DDD|2017-11-28|
I want to ...
-1
votes
0
answers
36
views
datetime.utcfromtimestamp weird behavior
I am writing a python script to simulate the 2038 epoch overflow. I noticed a weird behavior of the function datetime.utcfromtimestamp
import time
from datetime import datetime
max_signed_value = 2**...
0
votes
0
answers
29
views
How can I edit the timestamp on remix to enable time acculation
I'm creating an application, that tracks users' listening time, and transfers a reward when they pass the average time threshold, how can I edit timestamp on remix to ease testing.
function ...
0
votes
1
answer
26
views
Convert "Unix Epoch Time" to human readable time using time.gmtime raises OSError "invalid argument"
Converting Unix Epoch time to readable time information. Trials are as per below. It throws an error "OSError: [Errno 22] Invalid argument". Looks like the method does not like the given ...
-1
votes
0
answers
29
views
Script not producing correct output when run from cron [duplicate]
I have no idea what is happening here ?? I have a script which give the status of db down or up .if i run in normal terminal like command prompt its wrking but in crons only print and send mailx msg....
0
votes
1
answer
26
views
How to show date in 13-digit Unix Timestamp format in JSpreadSheet?
I have data, which contains date. It is saved in Unix Timestamp format. I am looking for a way, how to display this data in JSpreadSheet ("jspreadsheet-ce") so, that it looks like date (YYYY/...
0
votes
1
answer
22
views
Printf command adding extra space in the line
I am trying to create hdr record in unix script. I am using printf function to populate. printf statement added 2 spaces in the line.
I am using below code for that
REC_TYP="1"
SYS_ID=&...
2
votes
1
answer
51
views
Why is the constant 11644473600 used for converting FILETIME to Unix time?
I've been researching on how different operating systems represent time, as well as how to convert between them. I've read several pages that all describe a similar method for converting between ...
0
votes
0
answers
30
views
Huge discrepancy between file Mtimes from Rust and NodeJS
I've stumbled across a very unexpected issue, which is that I'm trying to download a file from a NodeJS server from Rust only if the destination file is older than the source. The mtime for the Source ...
0
votes
0
answers
105
views
Conversion of timestamp(long value) to date only(YYYY-MM-DD) in DBT
I'm trying to convert timestamp (long value) into date only (YYYY-MM-DD) with the below query.
SELECT
id,
scheme_name,
DATE(FROM_UNIXTIME({{'scheme_t'}})) AS scheme_date
FROM
...
0
votes
1
answer
96
views
How to automatically convert UNIX Epoch Timestamp to Timestamp Column in Snowflake during ingestion
I'm doing some CDC from MySQL to Snowflake using Debezium and i'm running into an issue with UNIX Timestamps. Most of my timestamp columns are stored as UNIX Timestamps and when I'm loading the data ...
0
votes
1
answer
111
views
Date.now() and DateTime.now() returns different value in Flutter Client and NodeJS server
I am trying to implement a turn-based counter on my Flutter app with the NodeJS backend.
I am storing the timestamp of each turn on the server using Date.now() (which returns a timestamp).
The flow is ...
2
votes
1
answer
31
views
from_unixtime function not giving correct output in spark-sql
Note - I have looked over the internet, all the solutions are present in either python or scala but not in java.
I am reading data from a json file. In the file the time is given in unixtime format. I ...
0
votes
0
answers
24
views
Why does MariaDB's default cast timestamp to integer method works this way?
I recently noticed that casting a TIMESTAMP value:
SELECT CAST( timestamp_column_name AS int ) FROM table;
Which gives the same result as casting to a FLOAT, does not correspond to the 'natural' ...
0
votes
1
answer
43
views
Working with shell scripts on hp-ux and need to convert time to epoch using date command. How to solve bad format character -s error?
To Work on few shell scripts and I need to get the time in terms of epoch in hp-ux
I tried using
date +%s
but i got bad format character - s error
i am allowed to use -u and -a options with date ...
-1
votes
1
answer
116
views
Kotlin: how to get the start time of a day and end time of a day?
My input is unix seconds from epoch, which represents the date, that I need to work with, I need to convert the date to start time of a day and end time of a day of the same date, what are possible ...
0
votes
1
answer
32
views
Datetime / Unix Date convertor [duplicate]
I need an input prompt that will allow the user to enter a date at the point the function is called and then run to concert the date to Unix date for an API call later in the program.
At the moment ...
0
votes
2
answers
57
views
How to convert current date time into time zone format using PowerShell?
I am trying to convert the current date time into the format "2023-05-25T09:51:55" using time zone Central European Time using PowerShell but getting below error.
**Exception calling "...
0
votes
2
answers
31
views
Unix time to regular date and time format using pyspark
I have unix time data from some logs, I want to transform then into regular dates and time
for example I have 1683825723389 and I get +553280424 or +55328-04-24 15:36:29
I tried:
.withColumn("...
0
votes
0
answers
23
views
How Can i deserialize a unix timestamp (μs) to a DateTime from JSON? [duplicate]
{
"time": 1627277852344
}
My C#
public class EventNotification
{
public long time { get; set; }
}
public class WebhookReceiver : IReceiveWebhook
{
private readonly ...
0
votes
0
answers
8
views
Timestamp(Time difference) with respect to current Time
I am using below piece of code to get the current date and time
Whereas the time is displayed wrongly here, it shows less than 1 hour of current time.
import java.sql.Timestamp
Timestamp currTimeStamp ...
0
votes
0
answers
34
views
Python Pandas datetime to Unix timestamp multiple different results
I found a few approaches how to convert the Pandas datetime to Unix timestamp, however the results are not the same. What am I doing wrong, why the res1 = res2 = res3 != res4? (there is 3,600 second ...
1
vote
0
answers
49
views
How to send a unix timestamp of specific time of day using React?
In React 18.2.0, i am trying to send a timestamp data of today's 00.00 AM (and if it's necessary GMT +03.00 timezone) in HTTP request. To do this, i'm keeping timestamp data in a state named unixDate. ...
0
votes
0
answers
107
views
In Elastic Index Templates, how to Map any Field to @timestamp?
I want to create a data stream on elastic. In order to do so, I need to first create an index template. All index templates expect to have a @timestamp field. I only have a field called 'ts' with ...
1
vote
1
answer
157
views
Safely convert a Pandas datetime Series to Int64 epoch timestamp, preserving nulls
Consider a datetime-dtype Series containing some null values:
import pandas as pd
t = pd.date_range('2022-01-01', '2022-01-02', freq='4H').to_series('t')
t.iat[2] = None
2022-01-01 00:00:00 2022-...
0
votes
0
answers
48
views
timestamps into 10 minutes interval per row with Pyspark [duplicate]
I have some data with timestamp in unix format, and I need to aggregate my data by 10 minutes: to find ts_start and ts_end where timestamp between ts_start and ts_end, and ts_end - ts_start = 10 ...
0
votes
0
answers
25
views
Querying MongoDB with Unix Timestamps Always Returns Emtpy
I have created a mongo database with information pertaining to League of Legends matches fetched using the riot api. The dates the games were played are timestamped in unix. I am attempting to query ...
0
votes
2
answers
79
views
timestamp variable in unix
I am getting below data in in bash script variable exp_dt:
exho $exp_dt
Jun 5 08:25:42 2023 GMT
need help to convert it into format like "05-Jun-2023" and days remaining from current date ...
0
votes
0
answers
592
views
Grafana convert unix time to date in graphql query
Does anyone know how to convert unix time to date in graphql query?
I have something like this
my panel
I've got unix time in nanoseconds
Grafana version is 8.2.1
As I see it, I can't use math ...
0
votes
2
answers
55
views
Convert Local time into Long format from openweather Api
I obtained data from open weather API
dt:1679888142
timezone:7200
I'm trying to change UNIX time into local time by applying Date object in JavaScript followed by toUTCString() to get the local time.
...
0
votes
0
answers
40
views
How to fetch the date of the file from the folder in UNIX Shell Script?
I am beginner to Shell Script.
Just want to know how to fetch date of the file from the properties in the UNIX Shell Script?
When I put 'ls -lrt' , could fetch the date where as for last six months we ...
0
votes
2
answers
222
views
How to convert my date and time variables into Unix timestamp? JavaScript
My project schedules a message to be sent at a specific day and time, I store the day in one variable and the time in another. How can I convert these two variables to a unix timestamp?
var date = &...
0
votes
0
answers
23
views
PHP data export as csv - only provides results for older data
I have a form where the user can either A). Select a date range and export data within that range or B). Export all of the data (using the check box).
Exporting all of the data works flawlessly, ...
0
votes
1
answer
378
views
Convert date in DynamoDB from unix format using PartiQL
I am trying to select data from DynamoDB using the PartiQL new AWS feature. I have noticed that the date variable is stored in Unix format in Dynamodb. However, I want to convert it into human ...
0
votes
1
answer
39
views
Related to HOME path
If I enter
$ echo $HOME
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Why do I get this output? Why are /usr/local/bin and such in $HOME?
1
vote
0
answers
48
views
How do I properly collect user options to form a unix timestamp?
I have been attempting to format this code correctly in order to display an accurate UNIX time stamp.
The Code:
} else if (interaction.commandName === 'updateraidtime') {
const month = ...
-2
votes
1
answer
145
views
Unix timestamp to Excel datetime [duplicate]
How to convert the Unix timestamp(1662091200) to Windows timestamp format in Excel? VBA code might be helpful.
0
votes
1
answer
117
views
Time taken by loop/commands in usecs in shell script
I need to measure the time taken by command(s) in usecs inside my shell script
start_time ;
Command1;
command2;
end_time;
time_taken = end_time -start_Time;
I was looking at the Time commands, but ...
0
votes
1
answer
144
views
Generate epoch time [duplicate]
I want to convert my time_stamp string into epoch time but I am not good with datetime and related modules, so getting a little confused. I saw many solutions but none of them had date_time format ...
0
votes
1
answer
238
views
Using DateTime library in Remix to Convert Timestamp to DateTime format
If anyone is familiar with importing a library into Remix, then using it, maybe you can help. What i am doing pertains to this library...
https://www.npmjs.com/package/@quant-finance/solidity-datetime?...
-1
votes
1
answer
52
views
How to write a shell script to compare values numerically?
I want the file fig.txt read in a shell script like here the number is 8 so if the number/value is less and equal to the value 5000 it will alert via mail that lock file overflow and if not it will ...
0
votes
1
answer
47
views
PervasiveSQL Database dates conversion
I'm working on tables obtained from a PervasiveSQL database and I have some trouble managing dates.
In some of the fields dates are recorded in the format we use in Italy, dd/mm/yyyy, but in others ...
0
votes
3
answers
161
views
Convert From MediaWiki Time Format To Unix Timestamp In PHP [duplicate]
MediaWiki (the free software behind Wikipedia) stores database timestamps in a unique binary(14) format for fields of the database. This is described further in their timestamp documentation.
The ...
0
votes
0
answers
24
views
Retrieving the last modified file in a directory over FTP using a shell script with curl
I am getting pulling the data from server and placing that in my local.
curl --verbose --ftp-ssl--user 'username:password' ftp://abc.com:001//this/is/stackoverflow/ > /home/dir1/dir2/dir3
In ideal ...
0
votes
2
answers
47
views
Changing a Unix Timestamp to a Date in google sheet each time data is added
I am trying to convert a unix time stamp to a date in Google sheet. The problem I am having is I need the unix stamp to change to a date each time using a formula every time the data gets added to the ...
0
votes
0
answers
85
views
Convert 10 digit number from Legacy system to Date in SQL
I am converting data from a legacy system to SQL. I got to convert a 10 digit number (e.g. 1419120000) to SQL DateTime. I am able to do so using dateadd(second,1419120000,'1970-01-01'). This function ...
0
votes
2
answers
381
views
js unix timestamp - set minutes, seconds, milliseconds to zero for resulting timestamp of its hour
Given a unix timestamp such as 1424321864000 (Thu Feb 19 2015 04:57:44 GMT+0000) I would like to convert this to 1424318400000 (Thu Feb 19 2015 04:00:00 GMT+0000).
In other words I want to keep the ...
0
votes
0
answers
197
views
trino sql calculate any time unit from given timestamp
I am exploring a legacy code and came upon this trino sql query that calculates and groups by any given period , i.e. 86400 for a day, 3600 for hour, etc, from a timestamp field.
SELECT
COUNT(*) ...