| 1 |
// timezone tapset |
| 2 |
// Copyright (C) 2010 Red Hat Inc. |
| 3 |
// |
| 4 |
// This file is part of systemtap, and is free software. You can |
| 5 |
// redistribute it and/or modify it under the terms of the GNU General |
| 6 |
// Public License (GPL); either version 2, or (at your option) any |
| 7 |
// later version. |
| 8 |
|
| 9 |
|
| 10 |
/** |
| 11 |
* sfunction tz_ctime - Convert seconds since epoch into human readable date/time string, with local time zone |
| 12 |
* |
| 13 |
* @epochsecs: number of seconds since epoch (as returned by gettimeofday_s()) |
| 14 |
* |
| 15 |
* Description: Takes an argument of seconds since the epoch as returned by |
| 16 |
* gettimeofday_s(). Returns a string of the same form as ctime(), but |
| 17 |
* offsets the epoch time for the local time zone, and appends the name of the |
| 18 |
* local time zone. The string length may vary. The time zone information is |
| 19 |
* passed by staprun at script startup only. |
| 20 |
*/ |
| 21 |
function tz_ctime(epochsecs) { |
| 22 |
return (ctime(epochsecs - tz_gmtoff()) . " " . tz_name()) |
| 23 |
} |