Skip to content

Commit

Permalink
Use current time as date re #7617
Browse files Browse the repository at this point in the history
Also remove optional attribute of instrument (hard to determine).

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Sep 11, 2013
1 parent bc2441c commit 8819f68
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@ namespace DataHandling
writer.setNewLine("\n");
writer.setOptions(XMLWriter::PRETTY_PRINT);

// Get current time
Kernel::DateAndTime date = Kernel::DateAndTime::getCurrentTime();
std::string ISOdate = date.toISO8601String();
std::string ISOdateShort = ISOdate.substr(0,19); // Remove fraction of seconds

// Create document
Poco::XML::Document* mDoc = new Document();
Element* rootElem = mDoc->createElement("parameter-file");
rootElem->setAttribute("instrument", "TEST");
mDoc->appendChild(rootElem);
rootElem->setAttribute("date", "2013-09-11 04:00:00");
rootElem->setAttribute("date", ISOdateShort);
mDoc->appendChild(rootElem);

Element* gElem = mDoc->createElement("test-element");
Expand Down

0 comments on commit 8819f68

Please sign in to comment.