General\today in ISO format

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
drpartha
Posts: 43
Joined: Wed Dec 02, 2009 1:41 am

\today in ISO format

Post by drpartha »

I have strange problems when I try to display \today in ISO format. I tried the datetime package. Here is a MWE:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[yyyymmdd]{datetime}
\renewcommand{\dateseparator}{--}
\begin{document}
Today is::: \date{\yyyymmdddate\today}
Today is::: {\yyyymmdddate\today}
\end{document}
Almost anything I do leads me to errors. Here is a summary ::

Code: Select all

\usepackage[yyyymmdd]{datetime} %gives error Unknown option yyyymmdd
Today is::: {\yyyymmdddate\today} % gives error Undefined control sequence
Today is::: \date{\yyyymmdddate\today} %gives error Unknown option yyyymmdd
How exactly do I get the ISO format for \today ?

Many thanks,

partha

PS I tried the package isodat, but I have other problems there. Will post separately

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

\today in ISO format

Post by Johannes_B »

Hi, a little hint. Marking up code correctly gives you the possibility to directly compile the code with an online editor. This can be handy to rule out faults in ones own system.
Please add \listfiles to very beginning of your document and run the example. What does the file list say?

When calling the documentation via texdoc isodate, what version info does it give you?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
drpartha
Posts: 43
Joined: Wed Dec 02, 2009 1:41 am

Re: \today in ISO format

Post by drpartha »

I tried the hints given by Johannes_B Site Moderator. I do not seem to move forward. Please help me, or give me a location where I can get some workable solution. I am desperate.

partha
User avatar
drpartha
Posts: 43
Joined: Wed Dec 02, 2009 1:41 am

\today in ISO format

Post by drpartha »

I figured it out !

Code: Select all

\documentclass[american]{article}
%\usepackage{babel}
\usepackage[iso]{isodate}
\begin{document}
Today is ::: \today\\
Happy ?
\end{document}
It works now.

Thanks for putting up with me.

partha
User avatar
drpartha
Posts: 43
Joined: Wed Dec 02, 2009 1:41 am

\today in ISO format

Post by drpartha »

MWE for datetime package

Code: Select all

\documentclass[a4paper]{article}
\usepackage{datetime}
\newdateformat{yyyymmdddate}{\THEYEAR\ --\twodigit{\THEMONTH}\ --\twodigit{\THEDAY}}
\newdateformat{ddmmyyyy}{\twodigit{\THEDAY}\  -- \twodigit{\THEMONTH}\  -- \THEYEAR}
\begin{document}
{\bf{MWE for datetime package}}\\
Raw Default: \today \\
Today is ::: \yyyymmdddate\today \hspace{10ex}   ISO style\\
Today is ::: \ddmmyyyy\today  \hspace{10ex}   India style\\
\end{document}
All is well that ends well.

partha
Post Reply