Forum Discussion
3 Replies
Sort By
- SmartBear_SuppoSmartBear Alumni (Retired)Hello,
You have to parse your time stamp string to that, check : http://groovycookbook.org/basic_types/dates_times/ you get how to for this. In general your script could look like this:
import java.text.*
import java.util.*
def cal = Calendar.instance
def timeS = "2009-09-10 15:00:00"
Date d1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(timeS)
cal.setTime d1
println cal.getTimeInMillis()
let me know does it helps,
robert - taewooNew ContributorThanks Robert.
does your code sample take into account the letters "T" and "Z" in the time string? - SmartBear_SuppoSmartBear Alumni (Retired)Hello,
No. You should write your own date format:
new SimpleDateFormat("Date Format")
robert