Re: Timestamp to a string




>Tom Leylan wrote:
> People seem to be interpreting your question as "how do create and
> concatenate a date string" which I think we can see it isn't. Your main
> problem (it seems to me) is to recognize whether there is a date on the
> filename presently. You have to derive a function to test for the presence
> of a date which doesn't mistake some legitimate filename for your
> concatenated string.
>
> It isn't hard to do but you should isolate it into a single method
> IsDatePresent() or something like that so you can adjust the code if you get
> a false positive at some point. You know it should be attached to the end
> of the filename, it should follow a 99-99-9999 convention and the filename
> cannot be shorter than 11 characters or there couldn't be a date string
> attached (it had to have at least one character initially).

I Think you are the closest to my problem. To add to what I already
wrote, I want to give an option of specifying the timestamp format to
the user and append the timestamp to it if any formatting is present.
So the format can be "MM-DD-YYYY" or "MM-DD-YYYY 0.0.0" or any format
that is supported by "DateFormat" class. Looks like there is no direct
function which can do this - and writing a custom function to check for
all such cases would be very difficult ... I probably would restrict
the number of formats that can be specified.

Sandeep

.



Relevant Pages

  • Re: unit testing C++ code from perl
    ... void ReportAssert(char const* description, char const* filename, int const ... That's probably the complaint string for an error. ... Then we have a filename and lineNumber. ... void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value) ...
    (comp.programming)
  • Re: Timestamp to a string
    ... People seem to be interpreting your question as "how do create and concatenate a date string" which I think we can see it isn't. ... You have to derive a function to test for the presence of a date which doesn't mistake some legitimate filename for your concatenated string. ... the number of formats that can be specified. ...
    (comp.lang.java.programmer)
  • Re: Formula to convert yyyy.mm.dd to yyyy.mm.dd.ddd? (Perhaps a tricky one?)
    ... >>script set in old days to putting date at the required yyyy.mm.dd. ... >>But we've been needing the days in the filename, ... >Both results will be text string as Excel formatting cannot return the two day ... For the standard format one, ...
    (microsoft.public.excel)
  • Re: How to display month in 2 digits?
    ... concatenate function - String? ... Formatting the cell with a custom format of 00 (That's zero - zero) seems to ...
    (microsoft.public.excel.misc)
  • Re: DataSet XmlWrite error (c#) - URI formats not supported
    ... Based on error message, your string, which specifies location of the file to ... save is not correct or this format is not supported by DataSet. ... > System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding) +34 ...
    (microsoft.public.data.ado)