{"id":55473,"date":"2008-05-28T06:18:00","date_gmt":"2008-05-28T06:18:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2008\/05\/28\/hey-scripting-guy-how-can-i-report-back-file-dates-using-labels-like-today-yesterday-and-last-week\/"},"modified":"2008-05-28T06:18:00","modified_gmt":"2008-05-28T06:18:00","slug":"hey-scripting-guy-how-can-i-report-back-file-dates-using-labels-like-today-yesterday-and-last-week","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-report-back-file-dates-using-labels-like-today-yesterday-and-last-week\/","title":{"rendered":"Hey, Scripting Guy! How Can I Report Back File Dates Using Labels Like Today, Yesterday, and Last Week?"},"content":{"rendered":"<h2><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\" \/> <\/h2>\n<p>Hey, Scripting Guy! In Microsoft Outlook if you sort and group your email by date, you don\u2019t just get groupings that show the date; instead, you get groupings like Today, Yesterday, Last Week, etc. I\u2019d like to do something similar; I\u2019d like to look at the last-modified date for all the files in a folder, then report back that date as one of the following values: Today; Yesterday; This Week; Last Week; Older. Can you help me with this?<br \/>&#8212; DA<\/p>\n<p><img decoding=\"async\" border=\"0\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" height=\"5\" \/><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\" \/><a href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><img decoding=\"async\" class=\"farGraphic\" title=\"Script Center\" border=\"0\" alt=\"Script Center\" align=\"right\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" height=\"288\" \/><\/a> <\/p>\n<p>Hey, DA. You know, this past weekend the Scripting Guy who writes this column actually went to the movies: he ventured out to see <i>Indiana Jones and the Kingdom of the Crystal Skull<\/i>. (Incidentally, seeing this movie keeps him right on his usual pace: in 2007 he saw two movies, and now in 2008 he\u2019s seen one movie.) As far as the Scripting Guy who writes this column was concerned, the latest Indiana Jones movie was OK: it was entertaining, but ultimately pointless. But that\u2019s fine; after all, the Scripting Guy who writes this column is also a Seattle Mariner fan, and what are Mariner games if not entertaining but ultimately pointless?<\/p>\n<p>Interestingly enough, the movie \u2013 which, at the risk of giving away the plot, involves the search for a crystal skull \u2013 is based on fact: there really <i>are<\/i> crystal skulls (including a very nice one in the <a href=\"http:\/\/www.britishmuseum.org\/default.aspx\" target=\"_blank\"><b>British Museum<\/b><\/a>). Furthermore, a number of people believe that these skulls possess magical powers. According to one legend, there are 13 crystal skulls scattered about the world. If and when all 13 skulls are found and reunited (supposedly 8 of them have been found so far) \u2013 uh, well, <i>something<\/i> cool will happen, although no one is really quite sure <i>what<\/i> will happen. However, the consensus seems to be that, when reunited, the skulls will \u201c \u2026 form a grid matrix (reality is a consciousness holographic matrix) aligned with the 13th skull, allowing human consciousness to ascend (return) to its natural state of being, light.\u201d Or, as Frank Dorland once said, \u201c[The] crystal stimulates an unknown part of the brain, opening a psychic door to the absolute.&#8221;<\/p>\n<p>Which, believe it or not, actually makes more sense than the ending of the movie did. <\/p>\n<p>Needless to say, crystal skulls aren\u2019t all that easy to come by. Fortunately, there\u2019s a cheaper way to open a psychic door to the absolute; all you have to do is take a peek at the following script, a script that reports back file dates using labels like Today, Yesterday, and Last Week. Enjoy your trip to the psychic absolute:<\/p>\n<pre class=\"codeSample\">dtmToday = Date\ndtmFileDate = #5\/24\/2008#\n\nintDaysDifference = DateDiff(\"d\", dtmFileDate, dtmToday)\n\nIf intDaysDifference = 0 Then\n    Wscript.Echo \"Today\"\n    Wscript.Quit\nEnd If\n\nIf intDaysDifference = 1 Then\n    Wscript.Echo \"Yesterday\"\n    Wscript.Quit\nEnd If\n\nstrDayOfWeek = WeekdayName(WeekDay(dtmToday))\n\nIf strDayOfWeek = \"Sunday\" Then\n    If intDaysDifference &lt;= 7 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Monday\" Then\n    If intDaysDifference &lt;= 8 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Tuesday\" Then\n    If intDaysDifference &lt;= 2 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 9 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Wednesday\" Then\n    If intDaysDifference &lt;= 3 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 10 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Thursday\" Then\n    If intDaysDifference &lt;= 4 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 11 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Friday\" Then\n    If intDaysDifference &lt;= 5 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 12 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n\nIf strDayOfWeek = \"Saturday\" Then\n    If intDaysDifference &lt;= 6 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 13 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n<\/pre>\n<p>To begin with, don\u2019t let the size of this script scare you away; as you\u2019re about to see, much of it is duplicate code. The truth is, we probably could have cut this script down by half (at least). So then why didn\u2019t we do that? For this reason: because gazing at the entire script, just like gazing at a crystal skull, causes \u201c \u2026 the eyes [to] set up a harmonic relation stimulating the magnetism collected in that portion of the brain known as the cerebellum. The cerebellum therefore becomes a reservoir of magnetism which influences the quality of the magnetic outflow through the eyes, thus setting up a continuous flow of magnetism between gazer and crystal.\u201d<\/p>\n<p>Oh, and also because we wanted to make it very clear exactly what we were doing and how we were doing it. Therefore, we sacrificed a little brevity for a little more clarity<\/p>\n<p>We should also note that, for demonstration purposes, we\u2019ve hard-coded a single date into the script, and that\u2019s the only date the script actually works with. But don\u2019t panic: before we go we\u2019ll show you an expanded version of the script, one that can actually work with all the files found in a specified folder.<\/p>\n<p>For now, however, our script kicks off by using the <b>Date<\/b> function to retrieve the current date and store that value in a variable named dtmToday:<\/p>\n<pre class=\"codeSample\">dtmToday = Date\n<\/pre>\n<p>Once that\u2019s done we assign a hard-coded date (May 24, 2008) to a variable named dtmFileDate. And in case you\u2019re wondering, yes, this is the variable that \u2013 in our expanded script, not to mention our new, expanded consciousness \u2013 will be used to hold the last-modified date of each file.<\/p>\n<p>But first things first. Once we have the two date-time values we next use VBScript\u2019s <b>DateDiff<\/b> function to determine the number of days (<b>\u201cd\u201d<\/b>) between the two dates:<\/p>\n<pre class=\"codeSample\">intDaysDifference = DateDiff(\"d\", dtmFileDate, dtmToday)\n<\/pre>\n<p>That brings us to this block of code:<\/p>\n<pre class=\"codeSample\">If intDaysDifference = 0 Then\n    Wscript.Echo \"Today\"\n    Wscript.Quit\nEnd If\n<\/pre>\n<p>What we\u2019re doing here is checking to see if the number of days between the two dates is 0. Why do we do that? Well, if the difference is 0 that can mean only one thing: the two dates are the same (ignoring the time of day, of course). Therefore, that must mean that this file was last modified sometime today. With that in mind, we echo back the message <i>Today<\/i>, then use the <b>Quit<\/b> method to terminate the script.<\/p>\n<p>And why do we terminate the script? You got it: having already determined that the file was last modified today there\u2019s no need to do anything else. As they say, it\u2019s time to get on with our lives.<\/p>\n<p>Which is far more true than you might think. At least for the Scripting Guys.<\/p>\n<p>Now, what if the difference between the two dates is <i>not<\/i> zero? No problem; in that case, we next check to see if the difference is 1:<\/p>\n<pre class=\"codeSample\">If intDaysDifference = 1 Then\n    Wscript.Echo \"Yesterday\"\n    Wscript.Quit\nEnd If\n<\/pre>\n<p>We do that because \u2013 well, you\u2019re way ahead of us on this one, aren\u2019t you? And you\u2019re right: if the difference is just 1 day that must mean that this script was last modified 1 day ago (i.e., yesterday). Consequently we echo a message to that effect, then exit the script.<\/p>\n<p>Now it starts to get just a little bit complicated. <i>How<\/i> do things start to get a little bit complicated? Well, suppose today is Wednesday (which it is). If you just rush blindly into this, without thinking it over, you might think that, to determine if a file was last modified this week, you could simply check to see if the day difference between the two dates is less than 7. (So did the Scripting Guys just blindly rush into this without thinking it over? Do you really need to ask?) If the day difference between the two dates is less than 7 then, logically enough, the file must have last been modified this week, right?<\/p>\n<p>Wrong. Why? Well, suppose the difference in days between the two files is 4 (which, for our purposes, it is). In that case, that means that the file was last modified on Saturday, May 24, 2008. And guess what? If we assume that Sunday is the first day of the week, that means that the last modification took place <i>last<\/i> week. Granted, the file is less than 7 days old, but because the new week started on Sunday, well \u2026.<\/p>\n<p>In other words, it\u2019s not good enough just to know the difference in days between the two dates, we also have to know the current day of the week; as it turns out, both of those factors are used to determine whether a file was last modified this week, last week, or some previous time. <\/p>\n<p>See? We told you it was going to get a little bit more complicated.<\/p>\n<p>But have no fear: we figured out at least one way to deal with this issue. To begin with, we use this line of code to determine the current day of the week:<\/p>\n<pre class=\"codeSample\">strDayOfWeek = WeekdayName(WeekDay(dtmToday))\n<\/pre>\n<p>And no, your eyes are not deceiving you: we <i>do<\/i> have a function embedded within a function here. In this line of code we first use the <b>Weekday<\/b> function to return an integer value representing the current day of the week (1 for Sunday; 2 for Monday; 3 for Tuesday; etc.). We then use the <b>WeekdayName<\/b> function to convert that integer value into a recognizable string (e.g., Sunday, Monday, Tuesday, etc.). Finally, that string value gets stashed in the variable strDayOfWeek.<\/p>\n<p>So what do we do now that we know the current day of the week? Well, what follows are a series of seven If Then statements, each one designed to work against a particular day of the week. For example, here\u2019s the If Then block for Sunday:<\/p>\n<pre class=\"codeSample\">If strDayOfWeek = \"Sunday\" Then\n    If intDaysDifference &lt;= 7 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n<\/pre>\n<p>As it turns out, doing our calculations for Sunday (and for Monday, for that matter) is easy: that\u2019s because we don\u2019t have to worry about files having been modified this week. Why not? Well, because Sunday <i>is<\/i> the first day of the week the only way a file could be listed as <i>This week<\/i> would be if the file was last modified on that very same Sunday. However, if the file <i>was<\/i> modified on the same exact Sunday then we\u2019ve already marked it as <i>Today<\/i> and we\u2019ve already exited the script. Therefore, all we have to do is check to see if the days difference between the two dates is less than or equal to 7:<\/p>\n<pre class=\"codeSample\">If intDaysDifference &lt;= 7 Then\n<\/pre>\n<p>If it is, then the file was last modified last week. If not, then we mark the file as <i>Older<\/i>. See how that works?<\/p>\n<p>Now let\u2019s take a look at the If Then block for Wednesday:<\/p>\n<pre class=\"codeSample\">If strDayOfWeek = \"Wednesday\" Then\n    If intDaysDifference &lt;= 3 Then\n        Wscript.Echo \"This week\"\n    ElseIf intDaysDifference &lt;= 10 Then\n        Wscript.Echo \"Last week\"\n    Else\n        Wscript.Echo \"Older\"\n    End If\nEnd If\n<\/pre>\n<p>So what are we doing <i>here<\/i>? Well, for starters, we\u2019re checking to see if the day difference between the two dates is less than or equal to 3; if it is, that means the file was last modified this week. How do we know that? Because of this handy-dandy chart we made up for ourselves:<\/p>\n<table id=\"EOG\" class=\"dataTable\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\"><b>Day Difference<\/b><\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\"><b>Day Modified<\/b><\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">0<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Wednesday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">1<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Tuesday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">2<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Monday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">3<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Sunday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">4<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Last week (Saturday)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>If intDaysDifference is 3 or less, then the file was last modified this week.<\/p>\n<p>OK, but what if intDaysDifference is <i>not<\/i> 3 or less? Well, then we check to see if the value is 10 or less:<\/p>\n<pre class=\"codeSample\">ElseIf intDaysDifference &lt;= 10 Then\n<\/pre>\n<p>Why 10 or less? Because that would mean that the file was last modified last week, just like another of our handy-dandy charts indicates:<\/p>\n<table id=\"EAAAC\" class=\"dataTable\" cellSpacing=\"0\" cellPadding=\"0\">\n<thead><\/thead>\n<tbody>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\"><b>Day Difference<\/b><\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\"><b>Day Modified<\/b><\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">4<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Saturday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">5<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Friday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">6<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Thursday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">7<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Wednesday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">8<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Tuesday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">9<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Monday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"evenRecord\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">10<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Sunday<\/p>\n<\/td>\n<\/tr>\n<tr class=\"record\" vAlign=\"top\">\n<td>\n<p class=\"lastInCell\">11<\/p>\n<\/td>\n<td>\n<p class=\"lastInCell\">Older (Saturday)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>And, of course, we make similar checks for the other days of the week, adjusting the values within the If Then blocks as needed.<\/p>\n<p>Yes, we know. But if you\u2019re having trouble seeing how this all works pick another day (say, Thursday) and try making a couple handy-dandy charts of your own. Once you do that you should start to see how this all works.<\/p>\n<p>Now, what about that script that can calculate this date information for all the files in a folder? Well, here\u2019s a hunk of code that reports back the file name, last-modified date, and our little date-time calculation for each and every file in the folder C:\\Scripts. Give it a try and see what happens:<\/p>\n<pre class=\"codeSample\">dtmToday = Date\n\nSet objFSO = CreateObject(\"Scripting.FileSystemObject\")\nSet objFOlder = objFSO.GetFOlder(\"C:\\Scripts\")\n\nFor Each objFile in objFOlder.Files\n    dtmFileDate = objFile.DateLastModified\n    intDaysDifference = DateDiff(\"d\", dtmFileDate, dtmToday)\n\n    If intDaysDifference = 0 Then\n        Wscript.Echo objFile.Name &amp; \" -- Today\"\n    \n    ElseIf intDaysDifference = 1 Then\n    Wscript.Echo objFile.Name &amp; \" -- Yesterday\"\n\n    Else\n        strDayOfWeek = WeekdayName(Weekday(dtmToday))\n\n        If strDayOfWeek = \"Sunday\" Then\n            If intDaysDifference &lt;= 7 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n\n        If strDayOfWeek = \"Monday\" Then\n            If intDaysDifference &lt;= 8 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n        \n        If strDayOfWeek = \"Tuesday\" Then\n            If intDaysDifference &lt;= 2 Then\n                Wscript.Echo objFile.Name &amp; \" -- This Week\"\n            ElseIf intDaysDifference &lt;= 9 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n\n        If strDayOfWeek = \"Wednesday\" Then\n            If intDaysDifference &lt;= 3 Then\n                Wscript.Echo objFile.Name &amp; \" -- This Week\"\n            ElseIf intDaysDifference &lt;= 10 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n\n        If strDayOfWeek = \"Thursday\" Then\n            If intDaysDifference &lt;= 4 Then\n                Wscript.Echo objFile.Name &amp; \" -- This Week\"\n            ElseIf intDaysDifference &lt;= 11 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n\n        If strDayOfWeek = \"Friday\" Then\n            If intDaysDifference &lt;= 5 Then\n                Wscript.Echo objFile.Name &amp; \" -- This Week\"\n            ElseIf intDaysDifference &lt;= 12 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n\n        If strDayOfWeek = \"Saturday\" Then\n            If intDaysDifference &lt;= 6 Then\n                Wscript.Echo objFile.Name &amp; \" -- This Week\"\n            ElseIf intDaysDifference &lt;= 13 Then\n                Wscript.Echo objFile.Name &amp; \" -- Last Week\"\n            Else\n                Wscript.Echo objFile.Name &amp; \" -- Older\"\n            End If\n        End If\n    End If\nNext\n<\/pre>\n<p>And there you have, DA: that\u2019s how you can report back last-modified dates using labels like Today, Yesterday, and Last Week. As for crystal skulls, however, well, we can\u2019t really help you there: we don\u2019t know how to find them, and we definitely don\u2019t know how to make them. About all we <i>do<\/i> know is that, according to a somewhat-controversial analysis, the famed <a href=\"http:\/\/skepdic.com\/crystalskull.html\" target=\"_blank\"><b>Mitchell-Hedges<\/b><\/a> crystal skull (the Skull of Doom!) &#8220;\u2026 must have taken over 150 years [to make], generation after generation working all the days of their lives, patiently rubbing down with sand an immense block of rock crystal until finally the perfect Skull emerged.\u201d <\/p>\n<p>Needless to say, 150 years is a long time. And yet these ancient craftsmen <i>still<\/i> managed to get their crystal skull done faster than the Scripting Guys could write Part III of their <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/htas.mspx\"><b>HTA tutorial<\/b><\/a>. Wow; maybe the skulls really <i>were<\/i> made by extraterrestrials, or by some highly-advanced but long-lost civilization.<\/p>\n<p>Or maybe these ancient craftsmen just weren\u2019t as lazy as the Scripting Guys.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! In Microsoft Outlook if you sort and group your email by date, you don\u2019t just get groupings that show the date; instead, you get groupings like Today, Yesterday, Last Week, etc. I\u2019d like to do something similar; I\u2019d like to look at the last-modified date for all the files in a folder, [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[13,3,4,5],"class_list":["post-55473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-dates-and-times","tag-scripting-guy","tag-scripting-techniques","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! In Microsoft Outlook if you sort and group your email by date, you don\u2019t just get groupings that show the date; instead, you get groupings like Today, Yesterday, Last Week, etc. I\u2019d like to do something similar; I\u2019d like to look at the last-modified date for all the files in a folder, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=55473"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/55473\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=55473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=55473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=55473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}