cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1898
Views
0
Helpful
1
Replies

How to convert the current date format in ccx script

qilin zhang
Level 1
Level 1

Dears,

In CCX script, how can I compare the current date with the date get from SQL database.

The date format from SQL DB is 8 bits string type, that is yyyymmdd, and I want to list all of the entries as start from the current date and time in SQL DB.

So how can I convert the current date to string type and format yyyymmdd, so that I can compare the string date from SQL DB and select the entries, also the time HH:MM.

Thanks.

1 Reply 1

Samuel Womack
Level 5
Level 5

I would imagine you already figured this out.

java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");

java.util.Date dtToday = new java.util.Date(); //Date when Script Executes D[NOW]

String sCurrentDt = sdf.format(dtToday);