How do I subtract a second from a DateTime in Windows Phone 7?

Viewed 6659

I am trying to subtract a second from time value in a time picker. I found the code to add a second to the picker value, but I couldn't figure out how to subtract.

How should I go about doing it?

private static void CreateAlarm(DateTime time, string title)
{
    var alarm = new Alarm(title)
    {
        Content = "You have a meeting with your team now.",
        BeginTime = time.AddSeconds(10),
    };
}

private void SetAlarm_Click(object sender, RoutedEventArgs e)
{
    CreateAlarm(Convert.ToDateTime(timePicker1.ValueString), textBox1.Text);
}
1 Answers
Related