Forums Register Login

Java Regex pattern matching for current date time

+Pie Number of slices to send: Send
Hi All,
I want to use java regex for pattern matching current system date time. Basically I have a real time application and want to pick files that match the current date time stamp. Please suggest


Thanks
Thomas

+Pie Number of slices to send: Send
Thomas,
The time changes often. Think about what level of granularity you want - minute, second?

I would do this in two passes.
1) Get the month/day/year/hour/etc into variables
2) Build a regular expression matching the format of the datetime in your source string based on those values.

See how far you can get. Can you do this for just the year?
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3168 times.
Similar Threads
Pattern with wildcards
pattern matching
Remove Punctuations with regex
Strings replaceAll()
need help creating a java regex
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:44:12.