How to create DateTime.Now variable

Hi. I want to create a variable like that

DateTime.Now(dd/MM/yyyy hh:mm)

and I want to use this variable in my project but I could not do. How can I do ?

2 Likes

Hi
we can create that variable in variable panel with datatype as system.datetime or with a
assign activity
or to get a particular format then use a string variable like this
str_date = Now.ToString(“dd/MM/yyyy hh:mm”)

Cheers @sufyant

2 Likes

@sufyant

Create one string variable and assign below one.

    varDate = DateTime.Now.Tostring("dd/MM/yyyy hh:mm")
1 Like

What am I doing wrong @Palaniyappan @lakshman

1 Like

we wont able to mention the file format with / or \
so use this in str_date instead
str_date = Now.ToString(“dd_MM_yyyy_hh_ss”)

Cheers @sufyant

2 Likes

can’t I make a file name like this? ‘09/01/2020_16:45’

no buddy
it has / and a semicolon with both of this or even either of one, we wont be able to create a excel file or any text edit file
thats why suggested to go for underscore between each terms like ths
str_date = Now.ToString(“dd_MM_yyyy_hh_ss”)

Cheers @sufyant

1 Like

okay buddy thank you

1 Like

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