Welcome Guest | My Membership | Login

Convert C#/VB.NET Date/Time to Internal Date


Summary

When developing DotNet (.NET) applications, Date/Time objects are commonly used within business applications.  While the DateTime object give you a lot of functionality, it doesn’t have a native function to convert it back into a MultiValue Internal Date.

Since we always save dates in a compressed Internal formats within the MultiValue database, we have to convert the DateTime object into something we can store.

The easiest way to do this is to use the ICONV statement in the APIs provided by the database providers.

Dim _InternalDate As String
Dim _WinDate As Date = Now
_InternalDate = session.Iconv(_WinDate.ToShortDateString, "D")


While this is straight forward, there is a lot of additional override that may not be required.  You can easily convert your Date/Time object without using ICONV statement.

To do this, we take advantage of the OA Date format provided by by the DateTime object.  The OA Date format is the number of days before or after midnight, December 30 1899.  This is very similar to the MultiValve Internal date format, except for what is considered the Zero Date.

Read More...

Social Media Login

Use your existing social media logins to access your Membership/Subscription information.

Existing Magazine/Newsletter Subscriber (Quick Access)

If you are an existing International Spectrum subscriber, but have not registered with the website, please enter the Reference Code found on the magazine or in the e-mails you receive from us.

Magazine Reference Code location

Spectrum Login

New Subscriber

If you currently do not receive the Magazine or other emails from International Spectrum, select the "Subscribe" button below to create an new membership account.


 

Find out more about the different between the FREE and a Professional Membership at:
Compare Account Options

 

# # #          # # #          # # #

 

Related Articles

  • MultiValue BASIC and C# Syntax Comparison

    MultiValue BASIC is excellent for developing Business and Enterprise console applications, as well as string manipulation and business rules. Many people chose to use .NET for the GUI and UI development, whether it is ASP.NET, WinForms, or XAML. When working in these environments, it is handy to have a cheat sheet of how each language implements it syntax.

  • Convert Internal Date into C#/VB.NET Date/Time

    This article will show how to convert a MultiValue (PICK) Internal Date into a DateTime object that you can use in C# and VB.NET. The article will cover how use the OCONV statement, as well as, how to generate the DateTime object without using the OCONV statement.

  • Introducing OpenXML

    Company: Brian Leach Consulting, ltd

    With Word 2007, Microsoft introduced a new document format based on XML, thus opening the ability to work directly with the document structures. This first article introduces OpenXML and shows how to explore this new format.

  • MultiValue BASIC and VB.NET Syntax Comparison

    MultiValue BASIC is excellent for developing Business and Enterprise console applications, as well as string manipulation and business rules. Many people choose C#for the GUI and UI development, whether it is ASP.NET, WinForms, or XAML. When working in these environments, it is handy to have a cheat sheet of how each language implements it syntax.

  • MultiValue OCONV/ICONV in .NET - Date Conversion

    OCONV/ICONV commands are used extensively throughout our MultiValue systems. For many of us, they have become second nature, but to use them in other languages can cause problems. This article will explain how to mimic the OCONV/ICONV process in .NET for the Date Conversion codes.


Return to top