Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BirtDateTime calculation wrong?
BirtDateTime calculation wrong? [message #629127] Mon, 27 September 2010 10:08 Go to next message
Eclipse UserFriend
Originally posted by: abel.macadam.eden.invalid

Hi,

The report I build needs column heading containing the months, starting
with the previous month, the next column two months ago, etc. The
required result would be (as September is the current month)
aug jul jun etc.
(when the output is formatted as Date Time Custom MMM)

I can get this using the following formula:
BirtDateTime.addMonth(BirtDateTime.now(), -1) for the previous month
BirtDateTime.addMonth(BirtDateTime.now(), -2) for two months ago
etc.

However, when I get to:
BirtDateTime.addMonth(BirtDateTime.now(), -10)
I get unexpected results. Instead of
jan
I get
27 nov 2009 12:06

Instead of dec I get 27 okt 2009 12:06

What am I doing wrong?

Abel.
Re: BirtDateTime calculation wrong? [message #629185 is a reply to message #629127] Mon, 27 September 2010 12:54 Go to previous message
Richard A. Polunsky is currently offline Richard A. PolunskyFriend
Messages: 212
Registered: July 2009
Location: Houston TX
Senior Member

The function is working correctly. 10 calendar months prior to September 27 is November 27 of the prior year. You just need to either truncate the date or extract the month part of the name for your header.
Previous Topic:Tribix rtf export problem
Next Topic:beforeOpen not always called for sub-report?
Goto Forum:
  


Current Time: Tue Apr 23 15:33:03 GMT 2024

Powered by FUDForum. Page generated in 0.03085 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top