summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-11-19 12:18:35 +0530
committerAndinus <andinus@nand.sh>2020-11-19 12:18:35 +0530
commit04b437bcbd26480d60e4c514ff32bbeacf8881e7 (patch)
tree48181dcd066a85b6a7b60fcebf4d50337b056ec4
parent6ba91ec366a853d3b5dab64b3746af64726bca04 (diff)
downloaddraco-04b437bcbd26480d60e4c514ff32bbeacf8881e7.tar.gz
Add date to the document
-rwxr-xr-xdraco.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/draco.pl b/draco.pl
index a926246..6209123 100755
--- a/draco.pl
+++ b/draco.pl
@@ -6,6 +6,8 @@ use warnings;
 use HTTP::Tiny;
 use JSON::MaybeXS;
 
+use POSIX qw(strftime);
+
 # For wrapping comment blocks.
 use Unicode::LineBreak;
 my $lb = Unicode::LineBreak->new(ColMax => 76); # Default is 76.
@@ -46,6 +48,11 @@ my $post = $json_data->[0]->{data}->{children}->[0]->{data};
 # Start the Org document.
 print "#+", "STARTUP:content\n";
 
+# Print the date.
+my $date = strftime '%+', localtime();
+print "#+", "DATE: $date\n";
+print "\n";
+
 # Print the post title.
 print "* ", "$post->{title}\n";