# Convert given day to integer

**URL:** <https://forum.uipath.com/t/convert-given-day-to-integer/173300>\
**Category:** Help\
**Tags:** string, question, activities\
**Created:** [December 2, 2019, 8:59am UTC](https://forum.uipath.com/t/convert-given-day-to-integer/173300 "2019-12-02T08:59:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saleem\_basha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/saleem_basha/32/61955_2.png) [@saleem\_basha](https://forum.uipath.com/u/saleem_basha)\
**Post date:** [December 2, 2019, 8:59am UTC](https://forum.uipath.com/t/convert-given-day-to-integer/173300/1 "2019-12-02T08:59:01Z")

</div>

Someone can tell me how to convert given day to integer.  
For example, Monday to 1, Tuesday to 2 etc.,

Thanks.

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [December 2, 2019, 8:59am UTC](https://forum.uipath.com/t/convert-given-day-to-integer/173300/2 "2019-12-02T08:59:14Z")

</div>

You have to use just two assign [activities](https://docs.uipath.com/activities/docs/introduction).

Declare two variables -

**myDay** as String type  
**dayNumber** As Integer

Assign Activity, `myDay = “Monday”`  
Assign Activity, `dayNumber = (CInt([Enum].Parse(GetType(DayOfWeek), myDay)))`

Use MessageBox to display dayNumber which displays 1.

Regards,  
Karthik Byggari

---

<div class="post-metadata">

**Author:** ![saleem\_basha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/saleem_basha/32/61955_2.png) [@saleem\_basha](https://forum.uipath.com/u/saleem_basha)\
**Post date:** [December 2, 2019, 9:01am UTC](https://forum.uipath.com/t/convert-given-day-to-integer/173300/3 "2019-12-02T09:01:12Z")

</div>

Thank you, worked perfectly.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [December 5, 2019, 9:01am UTC](https://forum.uipath.com/t/convert-given-day-to-integer/173300/4 "2019-12-05T09:01:28Z")

</div>

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