git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH] Expose the raw timezone offset from PersonIdent

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 5, 2008, 01:37 UTC
Message-ID
<1220578639-11723-1-git-send-email-spearce@spearce.org>

Applications may wish to have this value, much as they can get the raw seconds-since-epoch and reformat it for their own uses.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/lib/PersonIdent.java      |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
index 5e524d3..bc5479a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
@@ -260,6 +260,14 @@ public TimeZone getTimeZone() {
 		return TimeZone.getTimeZone(ids[0]);
 	}
 
+	/**
+	 * @return this person's preferred time zone as minutes east of UTC. If the
+	 *         timezone is to the west of UTC it is negative.
+	 */
+	public int getTimeZoneOffset() {
+		return tzOffset;
+	}
+
 	public int hashCode() {
 		return getEmailAddress().hashCode() ^ (int) when;
 	}
-- 
1.6.0.1.319.g9f32b
Next: Robin Rosenberg
Message 1 of 3 in “Expose the raw timezone offset from PersonIdent”
  1. Expose the raw timezone offset from PersonIdentShawn O. Pearce, Sep 5, 2008
  2. Robin RosenbergSep 6, 2008
  3. Shawn O. PearceSep 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.