This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 29, 2011, 4:29 PM
53 Posts

NotesDateTime problem

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 7
OK, having more problems with a NotesDateTime object on the client in xpages
 
A field with:

var nDate:NotesDateTime = session.createDateTime("Today");
@Year(nDate.getDateOnly());

returns different values in the web and client - 2011 on the web, and 2013 on the client
 
My PC definitely has the correct time settings by the way.
 
Again, would be useful if anyone can confirm this
Mar 29, 2011, 4:55 PM
9 Posts
Re: NotesDateTime problem
Dan, what region are you working in? I'm in the UK and date/time fields display in UK format (DD/MM/YY) in the web client, but in US format (MM/DD/YY) in the Notes xpinc client 
Mar 29, 2011, 4:59 PM
9 Posts
Re: NotesDateTime problem
 Dan,
 
I tested your code and I get exactly the same result - 3 in the browser, 6 in the Note client. 
Mar 30, 2011, 9:15 AM
53 Posts
Re: NotesDateTime problem
Thanks, I'll submit a PMR. Have got round it by using a mix of javascript date objects and notesdatetime objects - I find notesdatetime objects easier to format into readable strings, but also needed the broken down values to be correct. So I've now got two different date objects to do what should be one thing
Mar 31, 2011, 9:36 AM
53 Posts
Re: NotesDateTime problem
According to IBM, @Year and other similar functions require a javascript date as the argument in xPages. The fact that it works in the web with notesdatetime.dateOnly is actually unexpected.
 
They didn't know of a way to get the year value from a NotesDateTime object in xPages, so gonna have to use a bit of a mixture I think

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal