aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-02 18:39:41 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-02 18:39:41 +0200
commitab47868639750010db01d7e846c9203bd7f00b2d (patch)
treee0b21fb83fbbbf2b212ff96c2c49f6b42ced09d0 /src
parent6d6467d376ff8ccc758c9fce1fe6d9b658956598 (diff)
Change lastModified to the number of seconds in the epoch
'lastModifiedDate' is now a string representing the equivalent date/time.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops/fetchTree.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index 79ddc45f5..8a4970726 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -34,9 +34,11 @@ void emitTreeAttrs(
if (tree.info.revCount)
mkInt(*state.allocAttr(v, state.symbols.create("revCount")), *tree.info.revCount);
- if (tree.info.lastModified)
- mkString(*state.allocAttr(v, state.symbols.create("lastModified")),
+ if (tree.info.lastModified) {
+ mkInt(*state.allocAttr(v, state.symbols.create("lastModified")), *tree.info.lastModified);
+ mkString(*state.allocAttr(v, state.symbols.create("lastModifiedDate")),
fmt("%s", std::put_time(std::gmtime(&*tree.info.lastModified), "%Y%m%d%H%M%S")));
+ }
v.attrs->sort();
}