datestrroman

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Text/Strs/Chars/Links
Introduced first in SolidGeometry 1.0, Creation date: 2012-12-11, Last change: 2025-09-14

returns a datestring as roman number



See Also: roman

Example Illustration

 missing image of datestrroman(S)

Syntax

S=datestrroman([S])

Input Parameter

S: datestr YYYY-MM-DD; default is datestr

Output Parameter

S: roman number string

Examples


datestrroman
datestrroman('2012-04-03')




Copyright 2012-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, datestrroman, converts a date string into a Roman numeral representation. It is part of the SolidGeometry library and was created by Tim Lueth.

Input Parameters

Output

Algorithm Steps

  1. Initialize S with the current date in 'YYYY-MM-DD' format using datestr(now, 'yyyy-mm-dd').
  2. Check if there is at least one input argument (nargin >= 1). If so, set S to the first input argument.
  3. Verify if S is a character string. If not, convert it to a date string using datestr(S, 'yyyy-mm-dd').
  4. Extract the year, month, and day from the string S using str2num on the respective substrings.
  5. Convert the year, month, and day to Roman numerals using the roman function.
  6. Format the Roman numeral date as a string in the format 'YYYY-MM-DD' using sprintf.

Example Usage

To convert the current date to Roman numerals, simply call datestrroman without any arguments. To convert a specific date, such as '2012-04-03', call datestrroman('2012-04-03').

Algorithm explaination created using ChatGPT on 2025-08-18 22:36. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21