Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove non-numeric characters from time stamp

Status
Not open for further replies.

cactus1000

Programmer
Aug 31, 2001
149
US
I need to use my session time stamp as a unique identifier for financial transactions.

How do I get the time stamp to display without commas, dashes, "a.m." "p.m." etc.?

I just need an unbroken string of numbers.

Any ideas?
 
1) Where is the time stamp coming from
and
2) What is the exact format you want it in?
(ie, seconds since some date, yymmddhhnnss, ?)

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
you could use replace statements...ie strX = replace(strY, "AM", "")

That probably wouldn't be the most efficicent approach as you would have to do a replace function for each character you want to remove from the string. Perhaps use the IsNumeric(strX) function with some type of loop that goes through each character of the time string.

It depends what you're using this for. If its going to be run fairly often, you might be concerned about efficiency and performance. You can always hack out a solution, but it won't always be the best way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top