timestamp

Prepend timestamp to each line received from stdin

旧城冷巷雨未停 提交于 2021-02-10 15:40:22
问题 Hi there I'm trying to create logs using bash but the time I'm getting is wrong. I'm running this in background. # log code here before executing curl script log "Yay I was started" curl https://example.com/process | sed "s/^/$(date -u) /" >> /path/to/logs.log & The time set after processing curl is the time it was executed not the time after I got the response. I need to get the time after the response. Here's the sample output (Wrong response) Fri Aug 21 01:43:12 UTC 2020 Yay I was started

Prepend timestamp to each line received from stdin

给你一囗甜甜゛ 提交于 2021-02-10 15:39:43
问题 Hi there I'm trying to create logs using bash but the time I'm getting is wrong. I'm running this in background. # log code here before executing curl script log "Yay I was started" curl https://example.com/process | sed "s/^/$(date -u) /" >> /path/to/logs.log & The time set after processing curl is the time it was executed not the time after I got the response. I need to get the time after the response. Here's the sample output (Wrong response) Fri Aug 21 01:43:12 UTC 2020 Yay I was started

PHP timestamp conversion with DateTime::createFromFormat()

拜拜、爱过 提交于 2021-02-10 13:01:26
问题 This code: $timestamp = 1423522800; // Timestamp for 2015-02-10 $date1 = DateTime::createFromFormat('U', $timestamp); echo $date1->format('d/m/Y H:i') . "\n"; echo $date1->format('U') . "\n\n"; $date2 = new DateTime('2015-02-10'); echo $date2->format('d/m/Y H:i') . "\n"; echo $date2->format('U') . "\n"; Gives me this output: 09/02/2015 23:00 1423522800 10/02/2015 00:00 1423522800 What the hell is going on? I think it's timezone related, but from the DateTime::createFromFormat() documentation:

Convert Julian Timestamp to Regular Time in UNIX

此生再无相见时 提交于 2021-02-09 01:57:12
问题 I need to convert Julian timestamp to Regular timestamp in UNIX using Bash. On Tandem OS, conversion is pretty straightforward - Example: 212186319010244541 $OLSAPP SYSTST 1> #interprettimestamp 212186319010244541 #interprettimestamp 212186319010244541 expanded to: 2455860 2011 10 25 16 10 10 244 541 I wish to do the same on UNIX environment. The conversion will be a part of a parser script. So one-liners would be greatly appreciated. UPDATE : INTERPRETTIMESTAMP inbuilt function on Tandem

Caused by: java.time.DateTimeException: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30

只谈情不闲聊 提交于 2021-02-08 19:46:37
问题 I am parsing dates like this: "Sat, 30 Jan 2016 00:03:00 +0300" But in some of the dates it throw me this exception: Caused by: java.time.DateTimeException: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30 or this: java.time.format.DateTimeParseException: Text 'Tue, 30 Jan 2016 00:06:00 +0300' could not be parsed: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30 Here is some of my code: DateTimeFormatter newformatter =

Apps Script - onEdit combine timestamp and username/email address not working

丶灬走出姿态 提交于 2021-02-08 10:16:15
问题 I'm attempting to pull the ActiveUser and Email Address of the person making the change to the Google Sheet and thought it would be possible using the following, but all I can get is the timestamp. If I change "var obj2 = (Session.getActiveUser().getEmail()); to literally anything else, it pulls the new data so I feel like the rest of my script is fine but can't figure out why it never pulls a username or address... Any thoughts as to what I'm doing wrong? I heard that possibly google does

Identify missing hours - find the gaps in time

强颜欢笑 提交于 2021-02-08 10:12:27
问题 I have a table with hours, but there are gaps. I need to find which are the missing hours. select datehour from stored_hours order by 1; The gaps in this timeline are easy to find: select lag(datehour) over(order by datehour) since, datehour until , timestampdiff(hour, lag(datehour) over(order by datehour), datehour) - 1 missing from stored_hours qualify missing > 0 How can I create a list of the missing hours during these days? (with Snowflake and SQL) 回答1: To create a list/table of the

Azure Stream Analytics 'TimeStamp By' in query doesn't works on job but works fine on test

馋奶兔 提交于 2021-02-08 04:49:20
问题 I'm working on a IoT project. I've a Raspberry pi which send data to an IoTHub on Azure. That Hub forwards that data to an Azure Stream Analytics Job. In my query I try to aggregate(here an average) all the data in a TumblingWindow of 1 minute but as a Timestamp I use a custom datetime sent in the data. I've tried many things but nothing seemed to work. the stream job seems to ignore the datetime I provide and just aggregate everything based on the arrival time. Only when using the "Test"

How to use Robocopy to copy files with TimeStamp in command line

谁说胖子不能爱 提交于 2021-02-08 03:43:16
问题 Following is my command to copy the files in my computer and from my computer to network. ROBOCOPY "K:\Builds" F:\Builds\ /E /COPY:DAT ROBOCOPY "E:\" "K:\Shan Khan\" /E /COPY:DAT How i can make timestamp in destination folder only when copying the file for example "K:\Builds" when copied to F:\Builds\ F:\Builds\ ---> F:\Builds_26092015 "E:\" when copied to "K:\Shan Khan\Workspace" "K:\Shan Khan\Workspace"---> "K:\Shan Khan\Workspace_26092015" Kindly note that K drive is password protected and

How to use Robocopy to copy files with TimeStamp in command line

孤者浪人 提交于 2021-02-08 03:42:29
问题 Following is my command to copy the files in my computer and from my computer to network. ROBOCOPY "K:\Builds" F:\Builds\ /E /COPY:DAT ROBOCOPY "E:\" "K:\Shan Khan\" /E /COPY:DAT How i can make timestamp in destination folder only when copying the file for example "K:\Builds" when copied to F:\Builds\ F:\Builds\ ---> F:\Builds_26092015 "E:\" when copied to "K:\Shan Khan\Workspace" "K:\Shan Khan\Workspace"---> "K:\Shan Khan\Workspace_26092015" Kindly note that K drive is password protected and