Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Build Forge Date timezone format issue

My location is in Sydney Australia and I have set the timezone to "GMT+10:00" instead of "Australian Eastern Standard Time". However when I used .date command .date %Y-%m-%d %H:%M:%S %Z, it will return my timezone as whole name instead of GMT+10:00 like this:

2013-04-16 11:48:12 AUS Eastern Standard Time

I realized rbf's .date is based on POSIX strftime() function, %Z is the name or abbreviation of time zone and %z (lowercase) is the numeric representation of timezone. However rbf does not have %z available.

is there a way to return the timezone as numbers as I am doing further processing with the returned time.

0 votes


Accepted answer

Permanent link
 The code filters based on allowed parameters (as I'm sure you've found, we will ignore %z).  As such, using .date, there isn't a way to do what you want to do.  You would have to make an external shell call to parse your timezone based on the TZ in that shell.  

This is a reasonable request, and one that is simple enough to implement.  I would suggest making an RFE submission to get the %z parameter supported by .date


Leo Hui selected this answer as the correct answer

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,122
× 19

Question asked: Apr 15 '13, 10:47 p.m.

Question was seen: 5,075 times

Last updated: Apr 16 '13, 11:17 a.m.

Confirmation Cancel Confirm