Expression for finding the current year

Hello Team,

Kindly advice on the VB or CSharp expression for finding the current date(dd/mm/yyyy).

Best Regards,
Kakooza Allan Klaus

Here is regular expression to match date

^([0-2][0-9]|(3)[0-1])(/)(((0)[0-9])|((1)[0-2]))(/)\d{4}$

Hi @Kakooza-Allan-Klaus ,

To find current date use expression as DateTime.Now.ToString(“dd/MM/yyyy”)
For current year DateTime.Now.Year

is this you want ?

3 Likes

Hi @ermanoj3101,

Thank you bro for your guidance.

Best Regards,
Kakooza Allan Klaus

1 Like

Hi @ermanoj3101,

What if I want to use a different format for example Aug 24, 2021.

Kindly advice

Hi @Kakooza-Allan-Klaus ,

You will find all format below:

1 Like

Thank you @ermanoj3101

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.