Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

How to convert the current date format in ccx script

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

How to convert the current date format in ccx script

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);

451
Views
0
Helpful
1
Replies
CreatePlease to create content