Suppose there is a law saying it is illegal to XYZ between 10 PM and 6 AM. If Alice XYZs at 11 PM, she cannot use "I didn't know about the law" as a defense. What if she does know about the law, but her watch (due to something she could not have known about or prevented) incorrectly shows that it is 9 PM, and she has no reason to doubt it's accuracy and has no other way to determine the time? Is the fact that she knew about the law and could not have reasonably known she was violating it a defense?
It depends on what the mens rea requirement is.
Mens rea if not specified in a criminal offence
In Canada, if this is a criminal offence, and a mens rea is not specified in the Criminal Code, the presumption is that the mens rea would be satisfied by recklessness, knowledge, willful blindness, or intention (Pappajohn v. The Queen,  2 SCR 120; R. v. Briscoe, 2010 SCC 13). The prosecution would have to show that Alice was at least subjectively aware of the risk that she was doing XYZ during the prohibited hours and proceeded nonetheless (this is recklessness; Sansregret v. The Queen,  1 SCR 570 ). Based on the facts as you've presented in the hypothetical, you may have ruled out the possibility that Alice was reckless. Although, depending on the time of year, it may be that the sun sets around 9pm, which may present some awareness of the risk that you have not accounted for in your hypothetical.
Mens rea if specified
If the text of the statute does specify a mens rea then that is what the prosecution needs to show. For example, if one is prohibited from doing XYZ while "knowing" that it is after 9pm, then the prosecution will have to demonstrate actual subjective knowledge of the time, or wilful blindness (which Canadian law takes to impute knowledge: Briscoe).
Additional burdens to make use of some mistakes of fact
Some offences put an even higher burden on the accused in order to rely on a mistake of fact. In sexual offences where the age of the complainant is relevant (e.g. that they 14 or younger, or 16 or younger, or 18 or younger), the accused cannot make out a mistake-of-age defence without showing they took reasonable steps to ascertain the age (see Criminal Code, s. 150.1).1
Presumptive mens rea for regulatory offences is much lower: strict liability, subject to a due-diligence defence
However, if this were a public-welfare/regulatory offence, like a provincial traffic law, or a licensing restriction on an aviation licence, or municipal by-law, there is no mens rea presumption. Rather, public-welfare/regulatory offences prima facie fall into the category of strict liability offences, subject only to a due-diligence defence (R. v. Sault Ste. Marie,  2 SCR 1299). Alice would have to show that she had a "reasonable belief in facts which, if true, would have rendered the act innocent". What it means to have a "reasonable belief in facts" is very fact-specific.2 Alice has to hold the belief herself, and the trier of fact must accept that a reasonable person would also have held that belief. Just as in the case for recklessness, I can imagine that the timing of sunset might pose a problem for a due-diligence defence in your particular example.
If the penalties for the offence do not include the risk of imprisonment, the offence can even be declared to be an absolute liability offence, in which due diligence is not even a defence (Re B.C. Motor Vehicle Act,  2 SCR 486).
1. For example, simply relying on a complainant's "language and statements indicating that she could be 14 years of age or older did not constitute taking reasonable steps or all reasonable steps to ascertain her true age in all the circumstances, especially after being warned by her mother to stop all contact or she would call the police and stating that the complainant was way too young for him" (R. v. Dragos, 2012 ONCA 538).
2. For example, for the sale of alcohol, "when the individual clearly appears to be underage, ... a duly diligent permittee would require at least two more pieces of ID confirming that the person was not a minor, question the individual about the ID, then decide if it is reasonable to serve the individual alcohol versus the youthful appearance of the individual" (Citynski Hotels Ltd. v. Saskatchewan, 2003 SKQB 314).
In addition to Jen's answer, I would like to add that the example used of Alice committing an illegal act as a result of ignorance of the facts pertaining to breaking a curfew is perhaps somewhat limited and discuss the notion of the "standard of knowledge" more generally. If you are asking about the question of the principle of "ignorantia juris non excusat" in general, as the title of your question suggests, then the concept of "ignorance of the facts" would vary heavily depending on circumstance owing to various legal and social reasons. Apologies if your question is specific to the facts of your example.
Jen has pointed out some standards that are used in various circumstances: subjective knowledge, actual subjective knowledge, reasonable effort to find out, strict and absolute liability. The last two don't really relate to what an accused had in mind when doing something, but they are one of many concepts that we use to deal with the issue of knowledge. In strict liability, we simply say that the issue of knowledge is not so important.
The overarching principle is that the standard of "knowledge of the facts" used varies depending on the illegal act committed. In some cases, we are more ready to find someone as having knowledge and to charge them for a crime. In other cases, for various reasons, we are more hesitant in doing this and would not want to make the accused's life so difficult. Which is why for some traffic accidents, as Jen mentioned, there is absolute liability; why for regulatory offences we impose strict liability subject to a due-diligence defence; and why in some criminal offences, the prosecution has the burden of proof in showing knowledge.
In Singapore, as a matter of drug deterrence among other reasons, drug traffickers are presumed to have knowledge of the fact that they were trafficking drugs on them (Zainal bin Hamad v Public Prosecutor). The burden of proof lies upon the accused to show that they did not have knowledge "of the facts". This has a significant practical effect, as many accused traffickers argue that they were given a package to traffic which they had no knowledge pertaining to. By reversing the burden of proof of knowledge, the prosecution has a much easier job in convicting an accused.
Apart from regulations and statutory laws, knowledge is also relevant in issues of civil and commercial law. In negligence, for example, a plaintiff needs to show that the defendant could have objectively foreseen that their negligent acts would result in harm (Caparo v Dickman). If a defendant misrepresents themselves to a plaintiff, he might not be liable if he did not know himself of the mistake (Solle v. Butcher), or he may be liable in negligence for not taking care to avoid negligent misstatements (Hedley Byrne).