timestamp

How to filter logs easily with awk?

我的未来我决定 提交于 2020-01-09 08:04:10
问题 Suppose I have a log file mylog like this: [01/Oct/2015:16:12:56 +0200] error number 1 [01/Oct/2015:17:12:56 +0200] error number 2 [01/Oct/2015:18:07:56 +0200] error number 3 [01/Oct/2015:18:12:56 +0200] error number 4 [02/Oct/2015:16:12:56 +0200] error number 5 [10/Oct/2015:16:12:58 +0200] error number 6 [10/Oct/2015:16:13:00 +0200] error number 7 [01/Nov/2015:00:10:00 +0200] error number 8 [01/Nov/2015:01:02:00 +0200] error number 9 [01/Jan/2016:01:02:00 +0200] error number 10 And I want to

How to convert TimeStamp to Date in Java?

喜欢而已 提交于 2020-01-08 15:39:54
问题 How do I convert 'timeStamp' to date after I get the count in java? My current code is as follows: public class GetCurrentDateTime { public int data() { int count = 0; java.sql.Timestamp timeStamp = new Timestamp(System.currentTimeMillis()); java.sql.Date date = new java.sql.Date(timeStamp.getTime()); System.out.println(date); //count++; try { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/pro", "root", ""); PreparedStatement

SQL sum 2 different column by different condtion then subtraction and add

雨燕双飞 提交于 2020-01-07 05:40:51
问题 what I am trying is kind of complex, I will try my best to explain. I achieved the first part which is to sum the column by hours. example ID TIMESTAMP CUSTAFFECTED 1 10-01-2013 01:00:23 23 2 10-01-2013 03:00:23 55 3 10-01-2013 05:00:23 2369 4 10-01-2013 04:00:23 12 5 10-01-2013 01:00:23 1 6 10-01-2013 12:00:23 99 7 10-01-2013 01:00:23 22 8 10-01-2013 02:00:23 3 output would be Hour TotalCALLS CUSTAFFECTED 10/1/2013 01:00 3 46 10/1/2013 02:00 1 3 10/1/2013 03:00 1 55 10/1/2013 04:00 1 12 10/1

C# Append Timestamp to Filepath

让人想犯罪 __ 提交于 2020-01-07 05:01:29
问题 I have the following problem or question, I have this function private void SavePic(Canvas canvas, string filename) { RenderTargetBitmap renderBitmap = new RenderTargetBitmap( (int)canvas.Width, (int)canvas.Height, 96d, 96d, PixelFormats.Pbgra32); // needed otherwise the image output is black canvas.Measure(new Size((int)canvas.Width, (int)canvas.Height)); canvas.Arrange(new Rect(new Size((int)canvas.Width, (int)canvas.Height))); renderBitmap.Render(canvas); //JpegBitmapEncoder encoder = new

Adding Time in HH:MM Format -SQL Query

我们两清 提交于 2020-01-07 04:39:04
问题 Sir/Mam, I am using Oracle 11g.I have the following table by the name "Timeduration". It contains time specified in hours and minutes.I want to get the total time in hour and minutes. Timeduration 05:37 06:40 03:45 02:50 07:58 I want the total time as 25:30. How can i write the code for this?? Please help me out." 回答1: with t as ( select '05:37' as timeduration from dual union all select '06:40' as timeduration from dual union all select '03:45' as timeduration from dual union all select '02

R timestamp with iteration for Machine Learning- 30 minute window

馋奶兔 提交于 2020-01-07 03:49:35
问题 I have a data frame with a timestamp column (converted to real time) that looks like this (only a small portion is shown): "2016-05-25 08:59:21 EDT" "2016-05-25 08:59:21 EDT" "2016-05-25 08:59:21 EDT" "2016-05-25 08:59:22 EDT" "2016-05-25 09:39:57 EDT" "2016-05-25 09:40:33 EDT" (Of course, there are other columns that are adjacent to the timestamp column.) What I want to achieve is...to divide all the data into 30 minute sections. So, I want all the data between 08:59:00 ~ 09:29:00 grouped

XMLGregorianCalendar to java.sql.Timestamp

早过忘川 提交于 2020-01-06 18:04:09
问题 I'm working with webservices, inserting records, that return a timestamp value in XMLGregorianCalendar type. I need to transform it in a java.sql.Timestamp value, so I use a function like this. public static java.sql.Timestamp getSqlTimeStamp(XMLGregorianCalendar xgc) { if (xgc == null) { return null; } else { return new Timestamp(xgc.toGregorianCalendar().getTime().getTime()); } } Timestamp timestamp=getSqlTimeStamp(ExitInXMLGregor.getTimestamp()); My problem is that in the server, the

Reliable Linux kernel timestamps (or adjustment thereof) with both usbmon and ftrace?

北战南征 提交于 2020-01-06 14:52:46
问题 I'm trying to inspect a kernel module that utilizes usb, and so from the module itself I'm writing a message to ftrace using trace_printk ; and then I wanted to inspect when does a USB Bulk Out URB Submit appear in the system after that. The problem is that on my Ubuntu Lucid 11.04 (kernel 2.6.38-16), there are only local and global clocks in ftrace - and although their resolution is the same (microseconds) as the timestamps by usbmon, their values differ significantly. So not knowing any

Convert DateTime to MySQL TimeStamp

我的梦境 提交于 2020-01-06 14:17:14
问题 I am doing this to save a DateTime in the MySQL database but when stored, the value is 2011-10-30 06:01:07 . 06 is supposed to be pm , not am : startTime.ToString("yyyy-MM-dd hh:mm:ss"); 回答1: Simply do this startTime.ToString ("yyyy-MM-dd HH:mm:ss"); where HH (capital H) shows 24 hours format. So when you try saving 2011-10-30 06:01:07 it suppose to be am and when you want pm you should save 2011-10-30 18:01:07 回答2: Add the value using parameters : MySqlCOmmand cmd=new MySqlCommand( "INSERT

how to specify format of timestamp while creating table in postgreSQL?

…衆ロ難τιáo~ 提交于 2020-01-06 14:14:26
问题 I have created table with query: CREATE TABLE Z ( A varchar(30), B varchar(30), C timestamp, D numeric, E varchar(30), F varchar(30), G varchar(30), H numeric ); Now, I have a csv file with delimiter '|' and entries in this file are like 1313131|131313131|20130103115041|20.0000000|ABCD|EFGH||0.0000000 I am trying following command to import the data in the table: \copy Z from filename WITH (FORMAT CSV , DELIMITER '|', NULL ''); But I am getting following error: ERROR: invalid input syntax for