Ethereal-dev: [Ethereal-dev] [PATCH] packet-time.c: absolute time in response

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Thomas Anders <thomas.anders@xxxxxxxxxxxxx>
Date: Wed, 12 May 2004 17:18:59 +0200
The attached small patch to packet-time.c makes the time response
more readable (IMHO, at least).

Works for me. Please review and apply.


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)
--- packet-time.c.FCS	2002-08-28 23:00:36.000000000 +0200
+++ packet-time.c	2004-05-12 17:16:52.000000000 +0200
@@ -61,10 +61,10 @@
     proto_tree_add_text(time_tree, tvb, 0, 0,
 			pinfo->srcport==UDP_PORT_TIME? "Type: Response":"Type: Request");
     if (pinfo->srcport == UDP_PORT_TIME) {
+      /* seconds since 1900-01-01 00:00:00 GMT, *not* 1970 */
       guint32 delta_seconds = tvb_get_ntohl(tvb, 0);
       proto_tree_add_text(time_tree, tvb, 0, 4,
-			  "%u seconds since midnight 1 January 1900 GMT",
-			  delta_seconds);
+			  abs_time_secs_to_str(delta_seconds-(guint32)(70*365+18)*24*3600));
     }
   }
 }