mp,
You should make the call to DateTime.Now only once. You could have an
issue if this runs around midnight at the end of the year (very small, but
definitely possible).
Rahter, do this:
// Append the format.
strbRetVal.AppendFormat("{0:yyyyMMdd}{1}", DateTime.Now,
m_chFieldDelimiter);
That should work.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"mp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am using :
> SystemDate= System.DateTime.Now.Year.ToString()
> +System.DateTime.Now.Month.ToString()+System.DateTime.Now.Day.ToString();
>
> strbRetVal.AppendFormat("{0}{1}",SystemDate,m_chFieldDelimiter);
>
>
>
> but this gives me : 200517
>
> I want the date to look like: 20050107
>
> How can I do this?
>
>
>
> Thanks
>
>