Suppose I have a table as follows:
populated with temperature samples of a couple times a second.
Let's say I want to find the temperatures which are 1 second apart:
And if I want to find the temperatures which are 1 minute apart:
What I dont understand is, why there is a multiplier of 100 and not 60, since there are only 60 seconds in a minute?
You haven't mentioned it, but I believe your database is MySQL. (At least it's not Oracle, which behaves way differently than this.)
When you add a number to a DATETIME value in MySQL, it gets converted to a numeric double value, with a microseconds part of .000000, i.e. YYYYMMDDHHMISS.000000.
In this numeric value, an increase of 100 corresponds to an interval of 1 minute of the datetime. You can test that by casting such a numeric value back to DATETIME. (If it is invalid, the CAST will return NULL.)
A correct way to work with DATETIME differences is to use the INTERVAL keyword.
Good day people,
Kindly advice on below please.
1) Formatting/ Arithmetic operation of given date
I understand from the AIX man date and some research that flag -d is not applicable for AIX shell scripting and some of the UNIX command date command is not available in AIX.
Please advice... (1 Reply)
Hey Guys,
I have looked for a solution throughout the forum for my particular question, but I cant find one. So I'm sorry if I overlooked it. I need to be able to 48 add hours to a particular DateTime string.
I have a variable named $startTime
I would like to be able to take that... (1 Reply)
Hi,
To get the batch status, I will need to check if the particular job started after 5PM. if the job start time is before 5 pm, then it means that the job has not started for this particular date. I will run the script with date as argument.
For eg:
BS 07/10/2012
Start time from the log is... (8 Replies)
Hi. I'm hoping there is a simple method where I'm able to generate a datetime string that looks like this (yyyymmddhhmm):
201106280830
The tricky part would be that I need this string to be today's datetime minus 1 year.
Is there anyway to do this? (3 Replies)
Hi,
I'm trying to find processing time of my script. Please can someone give me the commands to get the start/end time in "dd-mm-yyyy hh:mm:ss" and the differnce in seconds.
Thanks! (5 Replies)
Suppose I have a mysql table consisting of measurements taken during irregular intervals as follows:
CREATE TABLE data (datetime DATETIME, value INTEGER);
mysql> SELECT datetime, value FROM data;
+---------------------+---------+
| datetime | value |... (2 Replies)
Hi,
I'm trying to use datetime.pm function in Perl. I do not have in the library. Is there a way to get it and put it into library?
Thanks,
George. (1 Reply)