Release Notes for 409

Notes for Release 409

21 Likes

Client Difference Log

API Changes

Added Function void StudioService:OpenInBrowser_DONOTUSE(string url) {RobloxScriptSecurity}

Added Event BadgeService.OnBadgeAwarded(int64 userId, int64 creatorId, int64 badgeId) {RobloxScriptSecurity}

Added Enum DateTimeKind
	Added EnumItem DateTimeKind.Utc : 0
	Added EnumItem DateTimeKind.Local : 1

Moved Property EnableScriptCollabOnLoad
	from: Class DataModel
	  to: Class StudioData

Removed Tag [NotReplicated] from Class StudioData

(Click here for a syntax highlighted version!)

10 Likes

Quick question: Why is BadgeService.OnBadgeAwarded(int64 userId, int64 creatorId, int64 badgeId) is {RobloxScriptSecurity}?

With that out of the way, thanks for the updates and keep them coming!

8 Likes

Functions for DateTime are DateTime.new and DateTime.now. Not sure of arguments however.
image

10 Likes

Yeah for real. I was just thinking to myself how much easier this would be for creating custom badge awarded UI. But I’m gonna have to create my own AwardBadge wrapper and manually signal the client. This could have been so useful without the security.

16 Likes

Isn’t Enum.DateTimeKind.Local supposed to give you the seconds in local time?

I’m getting the exact same result as Enum.DateTimeKind.Utc. My timezone is NZDT (UTC+13). Should be 46800 seconds more?

print(DateTime.now(Enum.DateTimeKind.Local), DateTime.now())
-- 1573183453, Local 1573183453, Utc

EDIT: Apparently only affects formatting.

5 Likes

I’m curious about this DateTime library.

Here are the functions so far. (that i know of)

DateTime.now(DateTimeKind kind)

Creates a DateTime with Kind of the specified type or UTC type. Time appears to be what you will get with os.time()

DateTime.new(number years,number months,number days,number hours,number minutes,number seconds,DateTimeKind kind)

Creates a DateTime with Kind of specified type or UTC type. The time created is based on the six numbers passed through, or 0. Time appears to be created in a method similar to what os.time does.

DateTime.fromUnixTimestamp(number seconds,DateTimeKind kind)

Creates a DateTime with kind of specified type or UTC type. The time appears to be the first argument (seconds) or 0. Time appears to be limited in range from 0 to 32535215999 (truncated to an integer), not sure if this is true for the other functions.

DateTime.fromIsoDate(string DateTime)

If no arguments are passed, returns nil, same thing with numbers. With strings it will try to convert it to a number from ISO format (found example “2012-12-19T06:01:17.171Z”). But with anything else, roblox crashes.

Is it intended to crash, or should I make a bug report about this?

Also, what is the point of the DateTimeKind or even this datatype itself?
DateTimeKind appears to just be a part of the DateTime data type, and doesn’t affect how the time is set in the constructors.

Also, are there any properties/functions for this DateType?

I figured out one
.Kind
Describes the DateTimeKind of the DateTime.

Is there one for the time represented by the DateTime, or do I have to extract the number with some string manipulation?

4 Likes

This contains all the methods/properties of DateTime I’ve found so far. Interestingly AFAIK only support for American dates when formatting.

Hopefully they either change it based on locale or switch to ISO formatting - this will confuse a lot of people otherwise as dates on the web already do :confused:

1 Like

I’d imagine it’d be simple enough to convert the twelve-hour format to the twenty-four hour format manually though.

and shifting the order of the date too.