Windows.Globalization.Calendar.SetDateTime C# (CSharp) Method

SetDateTime() public method

public SetDateTime ( [ value ) : void
value [
return void
		public extern void SetDateTime([In] DateTime value);
		public extern void SetToNow();

Usage Example

Example #1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // TODO: Prepare page for display here.

            // TODO: If your application contains multiple pages, ensure that 
            // you are handling the hardware Back button by registering for the
            // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
            // If you are using the NavigationHelper provided by some templates,
            // this event is handled for you.
            FBSession sess = FBSession.ActiveSession;

            if (sess.LoggedIn)
            {
                LoginButton.Content = "Logout";
                Calendar cal = new Calendar();
                cal.SetDateTime(sess.AccessTokenData.ExpirationDate);

                ResponseText.Text = sess.AccessTokenData.AccessToken;

                ExpirationDate.Text = cal.DayOfWeekAsString() + "," +
                    cal.YearAsString() + "/" + cal.MonthAsNumericString() +
                    "/" + cal.DayAsString() + ", " + cal.HourAsPaddedString(2) +
                    ":" + cal.MinuteAsPaddedString(2) + ":" +
                    cal.SecondAsPaddedString(2);
            }
            else
            {
                App.InitializeFBSession();
            }
        }
All Usage Examples Of Windows.Globalization.Calendar::SetDateTime