[CMake] How to obtain "date of the day"

David Cole david.cole at kitware.com
Thu Aug 5 10:03:51 EDT 2010


On Thu, Aug 5, 2010 at 9:46 AM, Jean-Christophe Fillion-Robin <
jchris.fillionr at kitware.com> wrote:

> hi Folks,
>
> Earlier in the day, somebody asked me how he could obtain "today date"
> using cmake.
> I replied there was no direct way to obtain the date and I told him to use
> a macro I wrote.
> See
> http://viewvc.slicer.org/viewcvs.cgi/trunk/CMake/Slicer3TodayMacro.cmake?rev=11898&view=log
>
> Is there a better a way to retrieve "today date" ?
>


Not yet. But it would be a relatively easy feature to add to CMake if
somebody wants to sponsor it.

I envision a new cmake command, or an extension to an existing command (like
string with a NOW or NOW_UTC arg...) that returns a complete timestamp
string (something like "2010-08-04 14:00:44.235675 UTC") and/or the
components of such a string as a cmake list ("2010;8;4;14;0;44;235675;UTC").

Any sponsors out there? :-)


David



> Thks
> Jc
>
> --
> Phone: 1-518-836-2174
> Ext: 304
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100805/6a9dfe19/attachment.htm>


More information about the CMake mailing list