Questions tagged [datetime]

{datetime} is about either setting time stamps for your document or handling time data in {diagrams} (e.g., using {pgfplots}). If you are setting the date/time for a title, include the {titles} tag.

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

How to format date inputed from file in date format and percentage?

I have inputs with tuple (date, percent) in a csv file: (The date are integers with 44 000 <-> 18 June 2020) date,pct 44755,0.01925374 44756,0.01925374 44757,0.01925374 [...] 44768,0.018989264 ...
stackoverflower's user avatar
1 vote
1 answer
49 views

date format for specific date

I am using the package like this: \usepackage[nodayofweek, short]{datetime} So when I am using \today it shows exactly what I want like this: So I have two questions. One, how to omit the year? Two, ...
liaoming999's user avatar
0 votes
2 answers
37 views

Ouptut the current time using `datetime` to a file

How do I print the current time to a file using the datetime pacakge. While running pdflatex I am generating a foo.def in which I would like to add a comment at the top with the current date time in ...
Peter Grill's user avatar
0 votes
1 answer
37 views

How to customize display of date and time of compiling

How do I customize date and time display for the compile date and time? I see the datetime2 package gives many predefined options, but what if I want to do something unique? The datetime2 mentions the ...
BrianWilson's user avatar
4 votes
1 answer
129 views

Capitalizing first character of \today independently of the language

I'm writing a document class that uses the datetime2 package to write a month-year date in the title of the document. Here is a MWE: \begin{filecontents}[overwrite]{customclass.cls} \...
Pedro's user avatar
  • 43
0 votes
1 answer
40 views

Capitalize \dayofweekname first letter

I'm working with dates, in particular with \dayofweekname. Is there any way to capitalize the first letter (i.e. the output monday should become Monday)? I tried with \MakeUppercase and \...
Lorenzo's user avatar
  • 67
0 votes
1 answer
49 views

Get date from filename and format it

I was trying to customize the header of a document when I encountered some difficulties. I'm working on this project in which there are several .tex files and each one is named as yyyyMMdd.tex. My ...
Lorenzo's user avatar
  • 67
1 vote
0 answers
81 views

Visual Studio Code LaTeX date time

I am using visual studio code LaTeX workshop. Here is my code : \documentclass{report} \usepackage[yyyymmdd,hhmmss]{datetime} \title{my title} \author{author} \date{Compiled at: \today-\currenttime} ...
温泽海's user avatar
0 votes
0 answers
36 views

How do I set the x axis as a time axis?

\documentclass[11pt, a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[scatter, only marks] table[x ...
Tigas's user avatar
  • 475
1 vote
0 answers
42 views

Incomplete \iffalse when using datetime package and \write

Objective A function that enables me to write custom log data. The result is the command \writeToLog (see MWE), which writes its input to the file log.txt. Issue In my actual document I'm using the ...
Steven's user avatar
  • 153
1 vote
1 answer
47 views

Removing date while preserving month and year from \today?

I wish to format today's date as october 2022. Emphasis on the lowercase october. I know that \today gives me October 24, 2022. How can I extract just the month and the year? I tried using \the\month \...
nikhilweee's user avatar
  • 1,649
4 votes
3 answers
187 views

How to insert the next month, like /today?

I'd like to create a command that would insert the next month (in relation to the current one), like so: \command -> November analogously to \today. The command cannot be hardcoded, as the ...
Zubo's user avatar
  • 582
2 votes
1 answer
148 views

How to calculate the number of days (and weeks) between a date and \today

Background: I've been trying to find a way to get LaTeX to automatically calculate the number of days and weeks (and even years for the sake of completeness) elapsed between a predefined date and \...
3kstc's user avatar
  • 871
0 votes
2 answers
82 views

How to make counter which count mondays of specific month?

I want to construct a counter with two arguments - year and month, say \tt{year}{month}. The usage like blah-blah \tt{2022}{6}, blah-blah \tt{2022}{6} gives blah-blah 06/06, blah-blah 13/06. If the ...
nail's user avatar
  • 101
2 votes
3 answers
203 views

datetime, language not supported

I want to use the datetime package to get the name of the months, but the package does not support one of the languages I am using. I am writing a template (with a .sty file), so I want to be able to ...
Vebjorn's user avatar
  • 1,758
0 votes
1 answer
140 views

Set specific dates

I have spent a fair couple of hours on this, including searching this forum, but I still haven't managed to solve my issue, therefore decided to ask a question here. I am trying to run the following ...
Jan Stuller's user avatar
2 votes
1 answer
414 views

How to use two different date formats: yymmdd and dd/mm/yyyy?

I would like to be able to use, in the same document, these two date formats: dd/mm/yyyy (as default format) yymmdd (as "local" format) Why I want that? Because I would like to use the &...
zetyty's user avatar
  • 769
0 votes
0 answers
41 views

tabularx package compatibility for question 408900 (Protocol)

In the question How can make a protocol in latex? there is an interesting solution given by Werner. The problem is that if you try to insert it in a document using one (just one) of the following ...
c05772's user avatar
  • 864
0 votes
1 answer
1k views

How to change the timezone of my latex document irrespective of my computer time zone using datetime2?

I want to change the timezone format (say, I want to use always GMT-3 timezone). I am using the datetime2 package. Do I need to use the following command as mentioned in the manual? \DTMdisplayzone{〈...
PoreyS's user avatar
  • 276
0 votes
0 answers
106 views

How is \longdate defined in datetime

I would like to define my own date format similarly to \longdate or \shortdate with the datetime package such that it automatically changes based on the language selected for the babel package. ...
Jakob's user avatar
  • 855
0 votes
1 answer
46 views

How to combine these two expl3-based functions to show the day of week in English?

I wrote a function \projlib_datetime_calculate_day_of_week_with_year_month_day:nnn to calculate the "day of week" given the year, month and day (the algorithm adopted should work for dates ...
Jinwen's user avatar
  • 7,808
2 votes
3 answers
362 views

How can I extract a date from a file named YYYYMMDD.tex and convert it to date string?

I have a .tex file which is named 20160201.tex, and within that file, I would like to extract the filename without .tex and convert it to the string February 01, 2016? I am able to get the string via ...
Apen13's user avatar
  • 31
1 vote
2 answers
1k views

Adding date on right [closed]

I want a result like this, a simple date on the right. Sorry for the question, I'm a beginner
Gim_begginer's user avatar
0 votes
2 answers
642 views

How to get the date info right aligned correctly inline with the name info?

I want the date info to come inline with my name and produce a pdf similar to I used the following code This results in slight offset on the date display( I wonder why the date is displayed above ...
Divya K.S's user avatar
  • 101
1 vote
1 answer
278 views

display custom date with custom date format with datetime package

using 'datetime' package, one can produce a custom date with custom date format like this: \usepackage{datetime} \newdateformat{nwfmt}{\the\day, \THEDAY \monthday, \THEYEAR} \newdate{mydate}{21}{12}{...
user1850133's user avatar
3 votes
1 answer
75 views

Find every weekend in a week: \advdate, \datetime

I am creating my own calendar. That means for each page in my book a day is reserved: dd.mm.yyy (day of week). Via a foreach loop I change the current date: \usepackage{advdate} \usepackage{datetime} ...
Gérôme's user avatar
0 votes
2 answers
197 views

Offset section currenttime by hours

I want to change timezone in a section of a document. An hour offset from server time would suffice. Using package datetime, how do I add or subtract hours from date \today? Using advdate and datetime ...
Brailyn's user avatar
0 votes
0 answers
53 views

Change slash to dot in biblatex [duplicate]

I am wondering how it is possible to change mm/yyyy to mm.yyyy in biblatex. Are these used correctly? alldates=terse labeldate=year if I say labeldate = year, wouldn't that usually lead to omitting ...
user236381's user avatar
0 votes
1 answer
66 views

How to simply insert month and year in middle of the paragraph?

I am writing my thesis and I want to insert month and year of some past events at lot of places! How to do that? Can anyone suggest me a simplest way to do it? I am very much beginner in LaTeX. And ...
Bhargav Rajyaguru's user avatar
4 votes
1 answer
271 views

Date time in two rows in Italian format and time zone

I have now created this MWE: \documentclass[12pt,margin=3mm]{standalone} \usepackage{newtxtext} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usepackage{datetime2} \usepackage{fontawesome5} \...
Sebastiano's user avatar
  • 52.6k
0 votes
0 answers
112 views

How to add automatic Date that updates upon opening in Latex

I know there is a command called \today; this will show the date that the document is created. But how do I set the date that can automatically update depending on the date of opening the pdf?
bios's user avatar
  • 101
2 votes
1 answer
144 views

Using \today in \hyperref package

Posting a question for the first time so please let me know if I missed anything. I am working in a LaTeX document and here is what I want to achieve using the hyper ref package: Have a URL that is ...
Siddhant Khera's user avatar
1 vote
1 answer
203 views

Add days to a specific date in datetime2 in a for loop / foreach loop

I want to calculate the beginning and ending date of a week (first day is Monday, last is Sunday). This is working fine for a single date. Now I want to calculate the start and end of multiple weeks ...
ShadowEagle's user avatar
3 votes
0 answers
309 views

How do I add a dot inside the zeros on the date?

My MWE \documentclass[a4paper,11pt]{article} %%%%%%%%%%%%% dot with zero \makeatletter \newcommand*{\pmzerodot}{% \nfss@text{% \sbox0{$\vcenter{}$}% math axis \sbox2{0}% \sbox4{0\/}% \ooalign{% 0\...
Özgür's user avatar
  • 3,262
4 votes
1 answer
349 views

How can I convert a datetime month name to uppercase?

I'm trying to create a date style that results in 01 JUN 2020 \documentclass{article} \usepackage[USenglish]{babel} \usepackage[showseconds=false,useregional=text,calc]{datetime2} \...
kjekk's user avatar
  • 43
0 votes
0 answers
35 views

Expansion of datetime command

For a project I'm working on, I am writing text from a LaTeX document to a simple PHP document to use on a poster. However, I've run into a problem which I'm unable to resolve; I am using the ...
G. de Man's user avatar
  • 364
2 votes
1 answer
2k views

Print a date in LaTeX

I am looking for a LaTeX command or macro that will allow me to specify a date in a standard format which will then be formatted according to a globally set print format. For example, I would ...
s5s's user avatar
  • 155
1 vote
0 answers
84 views

Saving pdf with Date and name

I have a file called quotes.tex. When I run it, it creates my quote for that date for a certain customer. I now want to save this quote.pdf automatically as date_customer_quote. How can I do that? \...
Chris Peh's user avatar
  • 310
1 vote
1 answer
220 views

Create date for expiry - future date

I'm able to change today's date to different format: month YEAR, normal and digits. Now I also need to add a future date: 28 days from today. How can I do that? \documentclass[a4paper,12p]{article} \...
Chris Peh's user avatar
  • 310
1 vote
0 answers
30 views

Compare dates - display month/year only once [duplicate]

I want to compare dates and not display the same information twice. i.e. if I have been somewhere from 5/2/19 - 14/2/19 I want to display: "From 5th - 14th February 2019" rather than the long version, ...
Chris Peh's user avatar
  • 310
4 votes
1 answer
101 views

How to get the date in MM/DD format with datetime2?

Probably straightforward, but it eluded me so far. \documentclass[ 12pt %,draft ]{report} \usepackage{babel} \usepackage[en-US]{datetime2} \begin{document} \DTMdate{2020-02-19} % 02/19/2020 \end{...
Erwann's user avatar
  • 2,070
3 votes
2 answers
621 views

How can I assign unique numbers, or a sequence, in LaTeX?

I'm trying to make flashcards to export to Anki, a flashcard program. I'm using the following link: http://reh.math.uni-duesseldorf.de/~zibrowius/LatexNoteImporter/ I'd like to assign each card with ...
electriclady's user avatar
0 votes
0 answers
151 views

Make documents where the date printed on the document is automatically the date of creation of document

Is there a way to create latex documents where the date printed on the documents is always by default the date of creation of the document? I don't want to compile the same latex file 30 days later ...
user avatar
1 vote
1 answer
226 views

Set \currenttime to specifc date and time

So I know this question may come across a bit weird but I'm looking for a way to change what LaTeX considers the current time. (In other words what \currenttime is for LaTeX) I'd like to have this ...
BrainStone's user avatar
1 vote
1 answer
351 views

Generate schedule planner between two given dates

I am trying to generate a table with the following format: I am looking for a way to generate the dates given the initial week (In this case Jun 3 - 7) I tried using the package datenumber but I am ...
C. Zhihao's user avatar
  • 265
3 votes
1 answer
1k views

pgfplots: How to add time axis as second x-axis?

I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value. Minimum Working Example (MWE): \documentclass[border=5mm]{standalone} ...
Dave's user avatar
  • 3,668
2 votes
2 answers
179 views

Define cover colors based on current month

I am writing a style guide documentation and I want to make visually appealing what the document was updated using the cover color. The main idea is to automatically update cover color based on the ...
Igor's user avatar
  • 47
2 votes
1 answer
296 views

advancing dates in a 3-day syllabus

I am trying to adapt this advance date method for a 3-day syllabus without success. The goal is to create a M-W-F class schedule. The method in the link above is for a two-day schedule. It takes the ...
invictus's user avatar
  • 601
5 votes
1 answer
763 views

Adding clock-time at bottom left of every page

How can I add a time-stamp of the time of compilation of the latex document (day, and clock-time in the form of HH:MM:SS) at the bottom left corner of every page, below the contents of the document?
smilingbuddha's user avatar
0 votes
0 answers
117 views

Twice a week syllabus

I was trying to adapt the following code from three-times a week to two-times a week, unsuccessfully. Also, I want to change the date format so that it shows: Mon Jan 28. Any help appreciated. \...
Victor M Torres-Velez's user avatar

1
2 3 4 5
7