Date-time question
Hi, I would like to know if there is a way to get the string representation (3 chars) from a boost::gregorian::date, e.g. 10/03/2006 returns "Fri". This is a pretty fundamental functionality but I could not find anything in the documentation. I probably missed something. Could anyone help? Thanks Pshemek Kind regards Pshemek Przemyslaw Sliwa Global Foreign Exchange FX Risk Engine Development Merrill Lynch ( +44 (0)20 7995 4182 ) +44 (0)79 6325 2319 * Email: przemyslaw_sliwa@ml.com -------------------------------------------------------- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ --------------------------------------------------------
Hi, The boost::date does not provide directly a way to have string information on a date. You should look at the "Date Time Input/Output" chapter of the documentation to get the function you want. You have some example like this: //example to customize output to be "LongWeekday LongMonthname day, year" // "%A %b %d, %Y" date d(2005,Jun,25); date_facet* facet(new date_facet("%A %B %d, %Y")); std::cout.imbue(std::locale(std::cout.getloc(), facet)); std::cout << d << std::endl; // "Saturday June 25, 2005" Hope this will help you. Alexandre Gacon ________________________________ De : boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] De la part de Sliwa, Przemyslaw (London) Envoyé : vendredi 10 mars 2006 14:40 À : boost-users@lists.boost.org Objet : [Boost-users] Date-time question Hi, I would like to know if there is a way to get the string representation (3 chars) from a boost::gregorian::date, e.g. 10/03/2006 returns "Fri". This is a pretty fundamental functionality but I could not find anything in the documentation. I probably missed something. Could anyone help? Thanks Pshemek Kind regards Pshemek Przemyslaw Sliwa Global Foreign Exchange FX Risk Engine Development Merrill Lynch ( +44 (0)20 7995 4182 ) +44 (0)79 6325 2319 * Email: przemyslaw_sliwa@ml.com ________________________________ If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here http://www.ml.com/email_terms/ for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ ________________________________
participants (2)
-
Alexandre Gacon
-
Sliwa, Przemyslaw (London)