Skip to content

Commit e207b37

Browse files
fixed missing today() in TimeSkill (microsoft#577)
### Motivation and Context the method Today() in TimeSkill.cs and today() in TimeSkill.py was missing. Today must be an alias for Date. ### Description Add the method Today. Co-authored-by: Abby Harrison <[email protected]>
1 parent 5bd4517 commit e207b37

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

dotnet/src/SemanticKernel/CoreSkills/TimeSkill.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public string Date()
5252
return DateTimeOffset.Now.ToString("D", CultureInfo.CurrentCulture);
5353
}
5454

55+
/// <summary>
56+
/// Get the current date
57+
/// </summary>
58+
/// <example>
59+
/// {{time.today}} => Sunday, 12 January, 2031
60+
/// </example>
61+
/// <returns> The current date </returns>
62+
[SKFunction("Get the current date")]
63+
public string Today() => this.Date();
64+
5565
/// <summary>
5666
/// Get the current date and time in the local time zone"
5767
/// </summary>

python/semantic_kernel/core_skills/time_skill.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TimeSkill:
3232
{{time.timeZoneName}} => PST
3333
"""
3434

35-
@sk_function(description="Get the current time.")
35+
@sk_function(description="Get the current date.")
3636
def date(self) -> str:
3737
"""
3838
Get the current date
@@ -43,6 +43,16 @@ def date(self) -> str:
4343
now = datetime.datetime.now()
4444
return now.strftime("%A, %d %B, %Y")
4545

46+
@sk_function(description="Get the current date.")
47+
def today(self) -> str:
48+
"""
49+
Get the current date
50+
51+
Example:
52+
{{time.today}} => Sunday, 12 January, 2031
53+
"""
54+
return self.date()
55+
4656
@sk_function(description="Get the current date and time in the local time zone")
4757
def now(self) -> str:
4858
"""

0 commit comments

Comments
 (0)