Skip to main content



      Home
Home » Archived » BIRT » BirtDateTime calculation wrong?
BirtDateTime calculation wrong? [message #629127] Mon, 27 September 2010 06: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 08:54 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 10:46:19 EDT 2025

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

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

Back to the top