Results 1 to 7 of 7

Thread: Bformat ?

  1. #1
    Join Date
    Aug 2008
    Posts
    839
    Post Likes

    Bformat ?

    in my email recipient i can put in "%time().day" and get todays date as a single day (1,2,...31) put in the recipient email but when i put in "%time().prevDay%" i get yesterdays date and the time attached to the report subject. Example :25-Sep-20 3:24 PM PDT

    how do i word it to just show yesterdays date only as a single day (1,2...31)??

  2. #2
    Join Date
    Jan 2002
    Location
    Fort Worth\Dallas, Texas
    Posts
    1,935
    Post Likes
    Try this %time().weekday.previous%
    Go Rangers!

  3. #3
    Join Date
    Dec 2019
    Location
    U.S.A
    Posts
    5
    Post Likes
    You could try this if you just want the number of the previous day. %time().prevDay.substring(0,2)%

  4. #4
    Join Date
    Aug 2008
    Posts
    839
    Post Likes
    Thread Starter
    Quote Originally Posted by HvacControlsMan View Post
    You could try this if you just want the number of the previous day. %time().prevDay.substring(0,2)%
    just curious but is there a document somewhere that shows how to pull out specific pieces of info form abs time?

  5. #5
    Join Date
    Jul 2014
    Posts
    49
    Post Likes
    Help file...

    %time().prevDay().day% should work. time() is BAbsTime, prevDay is also bAbsTIme so day,month, year etc will all work. Anything with "get" can be used to return a value.


    module://docDeveloper/doc/baja-rt/javax/baja/sys/BAbsTime.bajadoc

  6. #6
    Join Date
    Jan 2015
    Location
    North Carolina
    Posts
    174
    Post Likes
    Learn to take advantage of the Baja docs. Each Java class in Niagara has its own methods and properties/fields. You can use these with BFormat to pull out tons of data. Below is straight from the bajadoc on BAbsTime.

    public BDate getDate()
    public final int getDay()
    public final int getDayOfYear()
    public static int getDaysInMonth(int year, BMonth month)
    public static int getDaysInYear(int year)
    public final int getHour()
    public long getMillis()
    public final int getMillisecond()
    public final int getMinute()
    public final BMonth getMonth()
    public final int getSecond()
    public BTime getTime()
    public final long getTimeOfDayMillis()
    public BTimeZone getTimeZone()
    public String getTimeZoneName(Context cx)
    public int getTimeZoneOffset()
    public String getTimeZoneShortName(Context cx)

    "public" is an access modifier, with public meaning anyone/anything can request data from it. The next item is the return data type (if specified), then the get("whatever") is the method. You can use these "get" methods to return values in BFormat.

  7. #7
    Join Date
    Aug 2008
    Posts
    839
    Post Likes
    Thread Starter
    thanks guys. much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •