Jump to content
UBot Underground

[Solved]Date Function: How to extract the year and month and date value?


Recommended Posts

The $date function return mm/dd/yyyy tt:tt:tt in my pc.

I want to get the value of yyyy , mm and dd, so that i get year=2012, month=05, day=15

 

Thanks in advance.

Link to post
Share on other sites

Here you go:

 

clear list(%date_1)
add item to list(%date_1, $date, "Delete", "Global")
clear list(%date)
add list to list(%date, $list from text($list item(%date_1, 0), "/"), "Delete", "Global")
set(#month, $list item(%date, 0), "Global")
set(#day, $list item(%date, 1), "Global")
set(#year, $substring($list item(%date, 2), 0, 4), "Global")

Link to post
Share on other sites

Hi thanks.

I use find regular expression to get the value too.

Hope i get it right.

  year = $find regular expression($date, "([\\d]+\\s)")
  month = $find regular expression($date, "(^[\\d]+)")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...