Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

UiPath-ADPv1 Exam - Topic 3 Question 60 Discussion

Posted by Miles on Aug 18, 2026 at 10:58 AM

How do you subtract a specific TimeSpan from "Today" in VB.NET?

Suggested Answer: D

TheTodayproperty of theDateTimestructure returns the current date with the time component set to zero1.TheSubtractmethod of theDateTimestructure returns a newDateTimeobject that is the result of subtracting a specified time interval from this instance2.TheTimeSpanstructure represents a time interval that can be expressed in days, hours, minutes, seconds, and milliseconds3.

Option D is the correct way to subtract a specificTimeSpanfromTodayin VB.NET. For example, the following code snippet subtracts one day and two hours from the current date and displays the result:

Dim ts As New TimeSpan (1, 2, 0, 0) ' One day and two hours

Dim result As DateTime = Today.Subtract (ts) ' Subtract from Today

Console.WriteLine (result.ToString ('d')) ' Display the result

Option A is not valid, because there is noSubtractSpanFrommethod in theDateTimestructure. Option B is not correct, because it subtracts theTimeSpanfrom the current date and time, not just the date. Option C is not valid, because there is noSubtractUsingDatemethod in theDateTimestructure.


Get Premium UiPath-ADPv1 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
AI
Aileen 3 days ago
Wait, is there really a method called SubtractUsingDate? Sounds weird.
LA
Lazaro 8 days ago
I thought it was B at first, but D makes more sense.
MI
Mitzie 13 days ago
D is the correct way to do it!
JU
Justa 18 days ago
Definitely D, it's straightforward!
TR
Trinidad 23 days ago
Wait, can you really subtract a TimeSpan like that?
MA
Maurine 29 days ago
A and C don't even make sense.
DO
Donte 1 month ago
I thought it was B, but I guess not.
AS
Ashley 1 month ago
D is the correct way to do it!
CO
Corazon 1 month ago
I have a vague memory of using "Subtract" with a TimeSpan, but I might be mixing it up with another question.
CA
Cathrine 2 months ago
I thought "Subtract" was the method, but I can't recall if it works directly with "Today" or if it needs "Now".
JA
Janna 2 months ago
I remember practicing something similar, and I feel like using "Subtract" is the way to go, so maybe D?
CH
Charlene 2 months ago
I think it's option D, but I'm not entirely sure if "Today" is the right object to use.
0/2000 characters

Save Cancel