WebMay 16, 2001 · > There is a mathematical formula for getting the day of the week: > > D = Day > M = Month > Y = the last two digits of the year > C = Century > > ((d + y) - (2 * c) + (y / 4) + (c / 4) + ((13 * m - 1) / 5)) % 7 = Day > > For the Day: 0 = Sunday, 1 = Monday, etc. > For some reason my program is a day off right now but I am positive I had it ... WebAug 30, 2005 · Is there an AS/400 function to display the day of the week for a date input? For instance of 8/30/2005 was input I would want to receive "Tuesday" as a result. I can …
Date & Time Support
WebMar 15, 2011 · RPGLE Sample Code to get day of week for the Current Date or any given date. ? // *Mon = 0 ... Sun = 6. Day_Of_Week = %rem(%diff(%date():d'0001-01-01':*days):7); Day_Of_Week = %rem(%diff(My_date:d'0001-01-01':*days):7); Day_Of_Week = … RPGLE convert date format from one to another; RPGLE %time() cheat sheet - … WebDec 1, 2024 · Use RPG to find the day of the week By NickLitten November 30, 2024 RPG, date, procedure, snippet, SRVPGM I wanted a handy little RPG code snippet to return the … einstein chat bot cookbook
how to find a week number? - Code400 -The Support …
Web6 rows · Jan 17, 2012 · Now anyone can have access to an easy-to-use procedure to get the day of the week from an RPG ... WebClick here for more RPGLE Date Articles DATE MATH With real date fields, and some additional supplied BIFs, date math couldn't be any easier. There are BIFs for adding and subtracting days, months, or years: appropriately, these are %days, %months, and %years. Below are some examples of how to use these BIFs with your date variable: ? 1 2 3 4 5 6 7 WebJul 22, 2004 · Here are a handful of expressions you can use with date data type fields in pure RPG. For concise code, these expressions can, and probably should, be wrapped in subprocedures: Deriving the Day of Week DoWk = %rem (%diff (MyDate:d’0001-01-nn’:*d) : 7) + 1; To return a number based on 1=Monday, use 01 for nn. For 1=Sunday, use 07 for nn. einstein ceramic bust tongue sale