I have extracted a batch start date property this way:
Configuration conf = new Configuration(false);
conf.addResource(new Path(System.getProperty("oozie.action.conf.xml")));
String batchStartDate = conf.get("batch.start.date");
I want it to be in UTC. So I've created a DateTimeFormatter:
DateTimeFormatter dateTimeFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").withZone(DateTimeZone.UTC);
If I call something like dateTimeFormat.parseDateTime(batchStartDate)
, it returns DateTime
while I need a string. Is it a proper approach to just call dateTime.toString();
? Or maybe it's better to go with dateTimeFormat.print(dateTime);
?