Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
Printing and Plotting
  • Product Communities
  • MicroStation
  • Printing and Plotting
  • Cancel
Printing and Plotting
Printing and Plotting Wiki How do I change the date format used in Text Substitution to reflect MM/dd/yy?
    • Sign In
    • Printing - Wiki
    • 3D Printing
    • -MicroStation
      • How do I change the date format used in Text Substitution to reflect MM/dd/yy?
      • +Printing - MicroStation
    • +Printing
    • +ProjectWise InterPlot Organizer

     
     Questions about this article, topic, or product? Click here. 

    How do I change the date format used in Text Substitution to reflect MM/dd/yy?

    Product(s): MicroStation
    Version(s): N\A
    Environment: N\A
    Area: N/A
    Subarea: N\A

    Problem Description

    How do I change the date format used in Text Substitution to reflect MM/dd/yy?

    Steps to Resolve

    I have two suggestions to obtain the desired format:

    1. In Windows set the "Short date:" to "MM/dd/yy" under (Windows 10) Control Panel->Language, Select "Change date, time, or number format", select the "Format" tab, (Windows 7) Control Panel->Region and Language, select the "Format" tab. Make sure to restart MicroStation. By changing this option it affects any other application that uses the "Short date" format.

    2. Create a Named Expression and use the same in the Replacement field of the Text Substitution

    I will suggest you keep your named expressions in the same .dgnlib where you keep your print styles.

    Open your .dgnlib
    In the MicroStation pulldown menus select Utilities->Named Expressions
    Click on the New Icon
    Enter a name under the "Internal Name" and "External Names" fields. In this example I will use _DateOnly for both fields
    Under "Keywords" select File
    Under "Symbol Sets", add System.string and System.DateTime
    Under Expression enter
    System.String.Format ("{0:MM/dd/yy}", System.DateTime.Now())

    Verify what your replacement string will look like by clicking on Test

    Now edit your pen table and edit the entry you have for the date.
    In the Replacement field enter:
    <expr?name=_dateonly>
    if the name of the fields are different use "Internal Name"
    Save your pen table, your results should reflect the desired results in the date format

    You can access Help on Named Expressions by entering "Named Expressions Dialog" under Search in MicroStation

    See Also

    https://communities.bentley.com/products/microstation/microstation_printing/w/wiki/13575/how-to-get-date-and-time-stamp-to-plot-using-a-single-microstation-pen-table-text-substitution-variable

    • Pen Table
    • Text Substitution
    • MicroStation
    • SELECTsupport
    • Share
    • History
    • More
    • Cancel
    • Ed Yepes Created by Ed Yepes
    • When: Fri, Sep 8 2017 10:25 AM
    • Ed Yepes Last revision by Ed Yepes
    • When: Fri, Sep 8 2017 2:19 PM
    • Revisions: 6
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies