Date logic..

Anyone can share the info/service that returns the output with current Day and HH:mm…

Meanwhile i will look into it too…

TIA,
RMG

pub.date:currentDate or getCurrentDateString.

You specify the pattern to get the format you want.

But that answer seems too obvious. What exactly are you looking for?

Thanks Reamon…

No…i am looking to get actual Day (Sunday,Monday etc…) in the output…

I tried to use Calendar.DAY_OF_WEEK…it returns output 7 but it should return 5??? so that based on this i can setup lookuptable and get the actual day name…

Update:I got this working…

Thanks,
RMG

I know that you have resolved this but for the future references and other people, you can achive that by using “EEE d MMM yyyy HH:mm” format where EEE is the day on the week, “d” is the date and MMM is the month in three letters.

1 Like

wow…nice trick and easy…Thank you Talha…

Wow, i have been searching this for a long time and this works. Thanks Talha

For posterity, the format strings that can be used with pub.date:currentDate or getCurrentDateString are documented in the built-in services reference and also in the Java doc for the SimpleDateFormat class.

I’m seeing something strange with this service.

When we call it with the “EST” timezone on unix server container1, it returns the “CST” time (which is the timezone specified in my .profile althought that should not matter). When we call it on the same physical server’s container2, it returns the EST time correctly.

Any idea what may be happening here? Does anyone know what java method is called by this pub.date:getCurrentDate WmPublic service?

Ok, just heard back from our Unix SA. Apparently, this server container is not running the “ntp daemon” which I suppose sync’s time across the enterprise. Here’s how to find out:

$ ps -ef | grep ntp
root 285 1 0 Nov 09 ? 36:02 /usr/lib/inet/xntpd

This is just what I need. Thanks to Talha and Reamon.