Convert a date to the default dateformat

Greetings,
in MS-Project in the Options is it possible to define the format of a date.
Now I need a function in VB.NET that return a string that representive the format of the MS-Project settings:
e.g.
Date is 19. April 2013
The Setting is "MM/DD/YYYY": ConvertDate(Date) => "04/19/2013"
The Setting is "YYYY-MM-DD": CovertDate(Date) => "2013-04-19"
Thank you!
   Michael

Michael,
I'm not quite sure exactly what you are trying to do but the GetField function will return the formatted date. For example, let's say the Start date of the first task is 1/1/14. If the general date option is set to show MM/DD/YY, then
Activeproject.Tasks(1).GetField(pjTaskStart) will give 1/1/14
If the general date option is set to show MM/DD/YYYY then the above will give 1/1/2014
If the general date option is set to show January 1, 2014 then the above will give January 1,2014.
And as far as I know, there is no way to read the general date option setting. It can only be inferred by using the above syntax.
Does that answer your question?
John

Similar Messages

  • How to convert any date format to default US format using javascript???

    Hi,
    I was trying to convert a date format to default US date format. The date format will vary according to different regions (It can be dd/MM/yyyy or MM/dd/yyyy or yyyy/dd/MM or any). I need to convert it in to MM/dd/yyyy always (US Format). Please give some
    solutions for the same.
    Warm Regards,
    Tony Joy

    hi
    it is not trivial task in common case. We faced with similar issue when tried to localize date times in display templates in Sharepoint 2013 depending on site's locale, which can be done only via javascript. In order to do it you need to add date time locale
    information from server side to client side, e.g. by defining global variable. See the following article for details:
    Localize datetimes in display templates in Content by search web parts in Sharepoint 2013. I extended OTB global object _spPageContextInfo with new property (as far as I remember this object is also available in Sharepoint 2010):
    <script type="text/javascript">
    jQuery(function() {
    if (typeof (_spPageContextInfo) != "undefined" &&
    _spPageContextInfo != null) {
    <%
    var ci = new CultureInfo(1033);
    var cultureSerialized = new JavaScriptSerializer().Serialize(
    new
    name = ci.Name,
    dateTimeFormat = ci.DateTimeFormat,
    numberFormat = ci.NumberFormat
    %>
    _spPageContextInfo.currentCultureSerialized = <%= cultureSerialized %>;
    </script>
    Having different date time formats for your locale, you may use
    Date.localeFormat function from MS Ajax for formatting the date in specific format. If in your case format is predefined you may hardcode it without adding DateTime formats from server side.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Can I include the date in the default photo name?

    Can I include the date in the default photo name?

    Very clear & helpful ...but why couldn't I find  a menu action like this via the Help/
    maybe I didn't search in the correct technical language or something....
    Thanks léonie

  • Example storing data in the default schema with a Web Dynpro application

    Hi,
    is there any example or tutorial for storing data in the default schema with a Web Dynpro application via SQLJ or Hibernate by using the default DataSource?
    Thanks for Help,
    Dirk

    Hi,
    When you create the TAB-Strip object you should be able to set the default displayed TAB against the properties of the TAB-Strip.
    Gareth.

  • How to convert internal date to the format of user default setting

    In the BDC program, I need to convert the date, such as the sy-datum 20070427, to the format of user default that is defined in T-code SU01, such as YYYY-MM-DD or YYYY.MM.DD, and so on.
    The user format has 6 six kinds, and it is not good idea to write the code to process. So I look for the functions or CLASS method to process. I can use the function 'ITS_GET_USER_DEFAULTS' to get the user default setting of the Date format and Decimal notation.The problem is that I can not find the function or CLASS method to convert the internal date to user's date format.
    The function: CONVERT_DATE_TO_INTERNAL can not do it.
    The CLASS method: cl_abap_datfm=>conv_date_int_to_ext may be do it. But I do know how exchange the parameters, and fail to make it work finely.
    Is there the functions or CLASS method to process it?
    Thanks a lot!

    Hi John,
    create a veriable :
    data: v_date type char10.
    then after getting the date in YYYYMMDD format, write the following statement.
    WRITE SY-DATUM TO V_DATE.
    this might solve your problem.
    Regards,
    Hemant.

  • How to convert LRAW data into the Format of JPEG TIF

    Hi All,
    I am getting data in LRAW from the table DRAO i want to change it into Binary for display,
    I want to display the content into JPEG TIF
    I am getting error when display that format is not suitable.
    Thanks,

    Hello Shilpi,
    you can use SCMS_XSTRING_TO_BINARY to convert the RAW data to Binary.
    BR, Saravanan

  • How to convert substring(date) as the format i need...

    Hi to everyone...
    actually i got a field (datetime) in this format: yyyy/mm/dd
    throught a function, i turned it in ex: 16/12/2012 (italian).
    the issue comes when i have to concat 2 dates as:
    min(date) || max (date)
    (range of the week)
    to do that, i have to use a CAST function as char (to allow me to use the Substring function)...
    but when i do that, format change automatically in dd/MMM...
    WHY??????
    10/DEC - 16/DEC
    (weeks n° 50)
    how can i turn the month DEC in DIC?or more simple in number as --> 10/12 - 16/12???
    at the beginning, i thought to the replace function, but i should to make a Replace nasted... or some kind of case when...
    have u a way more fast to figure out from this problem????
    many thanks guy!!!
    PS. OBIEE 11g
    Edited by: Barticchia on 17-dic-2012 5.52
    Edited by: Barticchia on 17-dic-2012 5.55
    Edited by: Barticchia on 17-dic-2012 5.57

    Can you try using Concat()?

  • Converting a Date in UTC to the current timezone

    I have a library which returns a Date in UTC.
    I need to convert this Date to the current timezone, and then format it using SimpleDateFormat.
    I've been trying for a while now, and I can't figure it out? Can anyone help?
    Thanks,
    Adam

    SimpleDateFormat takes a timezone.
    Date d = getDateInUTC();
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    TimeZone tz = TimeZone.getTimeZone("PST")
    sdf.setTimeZone(tz);
    String sDate = sdf.format(d);

  • Urgent!How to set the default selected date for an OAMessageDateFieldBean

    Hi,
    There is messagetextinput on the page.the dataType is Date.
    if I do not input anything on this messagetextinput ,when I click on the date icon,the default selected date is today.
    But I want to set the default selected date base on another messagechoice.
    Is that possible?
    binghao.

    Sumit/Binghao,
    When u set deafult date in the OAMessageDateFieldBean, the OAInlineDatePickerBean (which are referring as datepicker popup windows), takes the default value from OAMessageDateFieldBean.
    If you explore OAMessageDateFieldBean in framework, u will find its nothing but a onClick js event is called on the imageicon attached with messagetextinput bean(in case the type is Date) and OAInlineDatePickerBean is opened in a modal js window.
    So, here is code for setting default value both in both in OAMessageDateFieldBean and OAInlineDatePickerBean :
    OAMessageDateFieldBean dateField = (OAMessageDateFieldBean)webBean.findIndexedChildRecursive(<item id>);
    dateField.setValue(pageContext,new Date(100, 06, 04)/* 4th July 2000*/);
    One more important thing, here Date class is java.sql.Date.I hope i am clear.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Regarding Date data in the format of WEEKLY , MONTHLY , QUARTERLY , YEARLY

    hai
    i have one Infoobject(ZDATE) which is created based on the Reference Characteristic(ocalday) and contains data in the YYYYMMDD format.
    I want same date data in weekly , monthly , quarterly and yearly.
    So for this one i need to created ZWEEK , ZMONTH, ZQUARTER and ZYEAR infoobjects by using Reference Characteristics 0calweek , 0calmonth , 0calquarter , 0calyear and i need to write the formula for these InfoObjects for converting & getting data from the ZDATE.
    So please give the formulas for each InfoObject.
    I will assign the points
    bye
    rizwan

    Hi ,
    Try this for month and year in Transfer structure .
    zyear = zdate+0(4).
    zmonth = zdate+4(2).
    For quarter since it will be depend of what kind of fiscal period you are using.. say for ex april - march.
    For Week... whether you want find it based on calender year or fiscal period.
    Regards
    Balaji

  • Changing the default setting for forms in Acrobat 9

    When I go into forms in Acrobat 9 and use a Word doc to convert to a form the default boxes created initially are text.  IS there a way to change the default so the initial boxes created by the program are checkboxes?

    No, you have no direct control over how the Form Wizard behaves. There are things you can do with the design of the source document that can influence how automatic field recognition works. For example:
    http://acrobatusers.com/tutorials/designing-forms-auto-field-detection-adobe-acrobat
    http://blogs.adobe.com/loridefurio/files/loridefurio/DesigningForms-UE.pdf

  • Dynamic LOV with dates and selected default value

    Hello,
    I have a dynamic lov with dates. Query looks like this:
    select distinct concat(to_char(b.send_day_time,'YYYY.MM.DD HH24'),':00') display_value, to_char(b.send_day_time,'YYYY.MM.DD HH24') return_value
    from ...
    No I want to select a specific date as the default value. I put the following code for the default value:
    declare
    begin
    return to_char ('2008.02.19 10:00');
    end;
    But it doesn't work.The date (string) exists in the lov but it is not selected.
    Can someone tell me where the problem is?
    Thx in advance.
    Greetings,
    hamburger

    Hi hamburger,
    As return value you specified to_char(b.send_day_time,'YYYY.MM.DD HH24'),
    so your default value should be like to_char('2008.02.19 10'). Also pay attention to select the "Default Value Type".
    Hope this helps.
    chrissy

  • How to make a subscription use the default value for a parameter

    Hi everyone,
    I need to use the CreateSubscription method and have this new subscription use a default value for certain parameter. How can I do this?

    Hi Marianne,
    I have to create the subscription programatically, which is different from what you mention. To further clarify my challenge:
    I have three parameters in a report: date-interval (string), start-date (date), end-date (date). If the user selects for example "last week" as the date-interval, the DEFAULT values for the other two are as follows:
    Code Snippet
    start-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-6)
    end-date=DateSerial(Year(Today),Month(Today),Day(Today)-Weekday(Today)-1)
    The user can then select intervals like "today", "yestarday", "this month" etc, and the other two parameters are calculated based on that date-interval parameter. Now, If I programatically create a subscription to a report that contains these three parameters and set a value of "last week" for the date-interval parameter, the subscription stores the fixed days (say september 10 to september 16) producing a report of the same week every time the subscription is run and not updating the correct interval to LAST-WEEK!. What should I put as the value for start-date and end-date when I create the subscription to have these two params get the DEFAULT calculated value based on the third param date-interval?
    Hope to have been more clear now.

  • Convert the date into user default date formate

    I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...

    actually by using dats or d type you can get the user specific date itself.
    but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
    1. retrieve the user format from usr01
        SELECT SINGLE datfm
          INTO w_datfm
          FROM usr01
         WHERE bname EQ sy-uname.
    pass w_datfm to the below FM (4th import parameter)
    2. create Z - FM and retrieve the user secific date
    FUNCTION ZFXX_USER_SPECIFIC_DATE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IW_DAY) TYPE  CHAR2
    *"     VALUE(IW_MONTH) TYPE  CHAR2
    *"     VALUE(IW_YEAR) TYPE  CHAR4
    *"     VALUE(IW_DATFM) TYPE  USR01-DATFM
    *"  EXPORTING
    *"     VALUE(EW_USER_DATE) TYPE  CHAR0008
    *1  DD.MM.YYYY
    *2  MM/DD/YYYY
    *3  MM-DD-YYYY
    *4  YYYY.MM.DD
    *5  YYYY/MM/DD
    *6  YYYY-MM-DD
    CASE iw_datfm.
      when '1'.
        concatenate iw_day iw_month iw_year
               into ew_user_date.
      when '2'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '3'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '4'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '5'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '6'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when others.
        clear ew_user_date.
    endcase.
    ENDFUNCTION.

  • Reg: error while converting a date datatype to the char using TO_CHAR function.

    Hello all,
    I'm trying to convert a date datatype to the specified format (i.e., by using vaariable using the to_char function in my sql,
    SQL:
    select 0 dummy,'select' from dual
    union all
    select a.COLUMN_ID dummy,
    (case a.DATA_TYPE when 'NUMBER' then '''''' || '||' || a.COLUMN_NAME || '||'',''||'
                      when 'DATE' then '''"''' || '||' || TO_CHAR(a.COLUMN_NAME,'&dateformat') || '||' || '''",''' || '||'
                      else '''"''' || '||' || a.COLUMN_NAME || '||' || '''",''' || '||'
                end)
    from DBA_TAB_COLUMNS a
    where a.OWNER = upper('&owner_name')
    and a.TABLE_NAME = upper('&table_name')
    union all
    select 998 dummy,''' ''' from dual
    union all
    select 999 dummy,'from &owner_name..&table_name;' from dual
    order by dummy
    error:
                      when 'DATE' then '''"''' || '||' || TO_CHAR(a.COLUMN_NAME,'DD-MM-YYYY') || '||' || '''",''' || '||'
    ERROR at line 5:
    ORA-01722: invalid number
    Please help me in resolving this, Thanks in advance.
    Regards,
    Konda.

    > ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
    This seems to be your specific network configuration.  It seems that your corporate network is blocking HTTPS requests which don't use port 443. Your ABAP system is configured to use a port other than 443. Either talk to your basis admins about changing your ABAP system configuration to use port 443 or talk to your network administrators to allow whichever port the ABAP system is running on.

Maybe you are looking for